You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.1.1.post1120+g407a460
Fork me on GitHub

This Page



Create a twin Axes sharing the xaxis

Create a new Axes instance with an invisible x-axis and an independent y-axis positioned opposite to the original one (i.e. at right). The x-axis autoscale setting will be inherited from the original Axes. To ensure that the tick marks of both y-axes align, see LinearLocator


ax_twin : Axes

The newly created Axes instance


For those who are ‘picking’ artists while using twinx, pick events are only called for the artists in the top-most axes.