CartesianAxes.twiny¶
- CartesianAxes.twiny()[source]¶
Add an axes locked to the same location with a distinct x axis. This builds upon
matplotlib.axes.Axes.twiny
.- Parameters
**kwargs – Passed to
CartesianAxes
. Supports all validformat
keywords. You can optionally omit the x from keywords beginning withx
– for exampleax.altx(lim=(0, 10))
is equivalent toax.altx(xlim=(0, 10))
. You can also change the default side for the axis spine, axis tick marks, axis tick labels, and/or axis labels by passingloc
keywords. For example,ax.altx(loc='bottom')
changes the default side from top to bottom.- Returns
proplot.axes.CartesianAxes
– The resulting axes.
Note
This enforces the following default settings:
Places the old x axis on the bottom and the new x axis on the top.
Makes the old top spine invisible and the new bottom, left, and right spines invisible.
Adjusts the x axis tick, tick label, and axis label positions according to the visible spine positions.
Syncs the old and new y axis limits and scales, and makes the new y axis labels invisible.