Make and return a second Axes that shares the *y*-axis. The new Axes will overlay *ax* (or the current Axes if *ax* is *None*), and its ticks will be on the top. Examples -------- :doc:`/gallery/subplots_axes_and_figures/two_scales`
(ax: matplotlib.axes.Axes | None = None)
| 2140 | |
| 2141 | |
| 2142 | def twiny(ax: matplotlib.axes.Axes | None = None) -> _AxesBase: |
| 2143 | """ |
| 2144 | Make and return a second Axes that shares the *y*-axis. The new Axes will |
| 2145 | overlay *ax* (or the current Axes if *ax* is *None*), and its ticks will be |
| 2146 | on the top. |
| 2147 | |
| 2148 | Examples |
| 2149 | -------- |
| 2150 | :doc:`/gallery/subplots_axes_and_figures/two_scales` |
| 2151 | """ |
| 2152 | if ax is None: |
| 2153 | ax = gca() |
| 2154 | ax1 = ax.twiny() |
| 2155 | return ax1 |
| 2156 | |
| 2157 | |
| 2158 | def subplot_tool(targetfig: Figure | None = None) -> SubplotTool | None: |