In pyplot, you can change the order of different graphs using the zorder option or by changing the order of the plot() commands. However, when you
zorder
plot()
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.
ax.set_zorder()
ax2 = ax1.twinx() ax1.set_zorder(10) ax1.patch.set_visible(False)