Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rileypeterson/279572184ded8e33aac4246030e4658a to your computer and use it in GitHub Desktop.
Save rileypeterson/279572184ded8e33aac4246030e4658a to your computer and use it in GitHub Desktop.
ax1.set_zorder(ax2.get_zorder()+1) # put ax in front of ax2
ax1.patch.set_visible(False) # hide the 'canvas'
from: http://matplotlib.1069221.n5.nabble.com/Control-twinx-series-zorder-ax2-series-behind-ax1-series-or-place-ax2-on-left-ax1-on-right-td12994.html
@rileypeterson
Copy link
Author

Add this line to put back the canvas:
ax1.patch.set_visible(True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment