Skip to content

anchored_artists don't support zorder argument #7650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
RafiKueng opened this issue Dec 20, 2016 · 11 comments · Fixed by #19789
Closed
2 tasks done

anchored_artists don't support zorder argument #7650

RafiKueng opened this issue Dec 20, 2016 · 11 comments · Fixed by #19789
Labels
Good first issue Open a pull request against these issues if there are no active ones! New feature topic: mpl_toolkit
Milestone

Comments

@RafiKueng
Copy link

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
@RafiKueng
Copy link
Author

RafiKueng commented Dec 20, 2016

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

at.zorder = 20

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Dec 20, 2016
@tacaswell
Copy link
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.

@tacaswell
Copy link
Member

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

@RafiKueng
Copy link
Author

RafiKueng commented Dec 20, 2016 via email

@RafiKueng
Copy link
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.

@tacaswell
Copy link
Member

I believe that #7344 is related?

@RafiKueng
Copy link
Author

RafiKueng commented Jan 9, 2017

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?

@tacaswell
Copy link
Member

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

@QuLogic
Copy link
Member

QuLogic commented Jan 10, 2017

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.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@tacaswell tacaswell added the Good first issue Open a pull request against these issues if there are no active ones! label Oct 16, 2017
@AhmadSenousi
Copy link

Is this problem Solved?

@timhoffm
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Open a pull request against these issues if there are no active ones! New feature topic: mpl_toolkit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants