Add an axes locked to the same location with a distinct x axis. This is an alias and possibly more intuitive name for twiny, which generates two x axes with a shared (“twin”) y axes.


**kwargs – Passed to CartesianAxes. You can optionally omit the x from CartesianAxes.format keywords beginning with x. For example: ax.altx(lim=(0, 10)) is equivalent to ax.altx(xlim=(0, 10)).


CartesianAxes – The resulting axes.


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.