Thanks to visit codestin.com
Credit goes to github.com

Skip to content

twin axes spines are overstruck #18495

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

Open
anntzer opened this issue Sep 15, 2020 · 2 comments
Open

twin axes spines are overstruck #18495

anntzer opened this issue Sep 15, 2020 · 2 comments
Labels
keep Items to be ignored by the “Stale” Github Action topic: ticks axis labels

Comments

@anntzer
Copy link
Contributor

anntzer commented Sep 15, 2020

Bug report

Bug summary

Currently, the spines of twin axes are drawn on top of the spines of the "base" axes. Given that they are both black, this is barely visible (because the antialiased parts are drawn twice), although it is a bit easier to see by making the axes edgecolors semitransparent.

Code for reproduction

from pylab import *
rcParams["axes.edgecolor"] = (0, 0, 0, .5); subplot(211); twinx(); subplot(212)

Actual outcome

test
The top spines are overstruck.

See also #11688 (comment) for a similar case of double-striking.

Expected outcome

We could make the spines of the twinned axes invisible, which would fix the issue. The only case this would break is e.g. https://matplotlib.org/gallery/ticks_and_spines/multiple_yaxis_with_spines.html, i.e. if people are moving the other axes' spine somewhere else (we'd document that you need to make it visible again, but it would be a bit tricky to auto-detect that and/or emit the relevant warnings, although I can imaging doing that with a bit of heavy machinery...).
axisartist.parasite_axes (https://matplotlib.org/gallery/axisartist/demo_parasite_axes.html, https://matplotlib.org/gallery/axisartist/demo_parasite_axes2.html) currently does make some spines of the parent invisible and some spines of the twin invisible, to avoid the double striking, and adds more machinery to restore the original visibilities when parasite axes are removed. (See also #13092.)

... or we could just decide the annoyance is too minor to be worth fretting about.

Matplotlib version

  • Operating system:
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:
@QuLogic
Copy link
Member

QuLogic commented Sep 15, 2020

It can also be a problem in tests, if using the comparison decorator: https://github.com/matplotlib/matplotlib/pull/18393/files#diff-663c17d0729218d60dbb862c286a17d4R332-R346

@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Aug 21, 2023
@anntzer anntzer added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Items to be ignored by the “Stale” Github Action topic: ticks axis labels
Projects
None yet
Development

No branches or pull requests

2 participants