Skip to content

anchored_artists don't support zorder argument #7650

Closed

Description

@RafiKueng

AnchoredText and other items from mpl_toolkits.axes_grid.anchored_artists don't accept zorder.

In the following example, the anchored text should be above the line:

import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.anchored_artists import AnchoredText

fig = plt.figure()
ax = fig.add_subplot(111)

at = AnchoredText("test", prop=dict(size=24,zorder=20), loc=3, frameon=True, zorder=20)
ax.add_artist(at)
ax.plot([0,1],[0,1],'r', zorder=10)

plt.show()
  • Matplotlib 1.5.3, Python 2.7.12 and 3.4.5 Platform OpenSUSE linux
  • How install mpl: pip install --update --user

Activity

  1. RafiKueng commented on Dec 20, 2016

    @RafiKueng
    Author

    one can however directly set the zorder on the at element:

    at.zorder = 20

  2. added this to the milestone on Dec 20, 2016
  3. tacaswell commented on Dec 20, 2016

    @tacaswell
    Member

    Without looking at the code, I expect this to be a matter of tracing through where the kwargs in AnchoredText get processed and ensure that zorder is properly handled.

  4. tacaswell commented on Dec 20, 2016

    @tacaswell
    Member

    @RafiKueng Would you be interested in taking a crack at sorting this out?

  5. RafiKueng commented on Dec 20, 2016

    @RafiKueng
    Author
  6. RafiKueng commented on Dec 20, 2016

    @RafiKueng
    Author

    note to myself:
    I also found other possible bugs in the ancored artists... (scalebar for example) I might clean up everything when I'm at it.

  7. tacaswell commented on Dec 21, 2016

    @tacaswell
    Member

    I believe that #7344 is related?

  8. RafiKueng commented on Jan 9, 2017

    @RafiKueng
    Author

    yes, looks like #7344 is related.

    Can anyone help me out: what's the reason for having mpl_toolkits/axes_grid, mpl_toolkits/axes_grid1, mpl_toolkits/axisartist and matplotlib/offsetbox.py? Should there some cleaning up happen or shoudn't one touch/move/delete anything?

  9. tacaswell commented on Jan 10, 2017

    @tacaswell
    Member

    There should be some cleaning up, but it needs to be done carefully so that we do not break user code without warning.

  10. QuLogic commented on Jan 10, 2017

    @QuLogic
    Member

    axes_grid is the original, and axes_grid1 and axisartist are split versions of them. I'm pretty sure matplotlib.offsetbox is the real implementation and the others just import it (of whatever's implemented there, anyway.) I've got a bit of cleanup ready for as soon as I've finished #7545.

  11. modified the milestones: , on Oct 3, 2017
  12. added
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Oct 16, 2017
  13. AhmadSenousi commented on Mar 26, 2021

    @AhmadSenousi

    Is this problem Solved?

  14. timhoffm commented on Mar 27, 2021

    @timhoffm
    Member

    @AhmadSenousi In general, issues are closed when they are solved. If that this was missed, you can easily run the minimal example above to see that this is not yet solved.

  15. modified the milestones: needs sorting, v3.5.0 on Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions