SubplotGrid.dualx¶
- SubplotGrid.dualx(*args, **kwargs)¶
Add an axes locked to the same location whose x axis denotes equivalent coordinates in alternate units for every axes in the grid. This is an alternative to
matplotlib.axes.Axes.secondary_xaxis
with additional convenience features.- Parameters
funcscale (
callable()
,2-tuple
ofcallables
, orscale-spec
) – The scale used to transform units from the parent axis to the secondary axis. This can be aFuncScale
itself or a function, (function, function) tuple, or an axis scale specification interpreted by theScale
constructor function, any of which will be used to build aFuncScale
and applied to the dual axis (seeFuncScale
for details).**kwargs – Passed to
CartesianAxes
. You can optionally omit the x fromCartesianAxes.format
keywords beginning withx
. For example:ax.altx(lim=(0, 10))
is equivalent toax.altx(xlim=(0, 10))
.
- Returns
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.