Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
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
frompylabimport*rcParams["axes.edgecolor"]= (0,0,0,.5);subplot(211);twinx();subplot(212)
Actual outcome
The top spines are overstruck.
See also#11688 (comment) for a similar case of double-striking.
Expected outcome
Wecould 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: