You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Applications are open for the 2018 John Hunter Matplotlib Summer Fellowship. Apply now!
Version 2.2.2.post1772+gd9240e24b
Fork me on GitHub

Table Of Contents



Create a twin Axes sharing the yaxis

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

ax_twin : Axes

The newly created Axes instance


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

Examples using matplotlib.axes.Axes.twiny