Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

twin axes spines are overstruck #18495

Copy link
Copy link
Open
@anntzer

Description

@anntzer
Issue body actions

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.