PyPlot move alternative y axis to background

You can set the zorder of an axes, ax.set_zorder(). One would then need to remove the background of that axes, such that the axes below is still visible.

ax2 = ax1.twinx()
ax1.set_zorder(10)
ax1.patch.set_visible(False)

Leave a Comment