MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / twiny

Function twiny

lib/matplotlib/pyplot.py:2142–2155  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2140
2141
2142def 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
2158def subplot_tool(targetfig: Figure | None = None) -> SubplotTool | None:

Callers

nothing calls this directly

Calls 2

gcaFunction · 0.85
twinyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…