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

Method sharey

lib/matplotlib/axes/_base.py:1310–1327  ·  view source on GitHub ↗

Share the y-axis with *other*. This is equivalent to passing ``sharey=other`` when constructing the Axes, and cannot be used if the y-axis is already being shared with another Axes. Note that it is not possible to unshare axes.

(self, other)

Source from the content-addressed store, hash-verified

1308 self.xaxis._scale = other.xaxis._scale
1309
1310 def sharey(self, other):
1311 """
1312 Share the y-axis with *other*.
1313
1314 This is equivalent to passing ``sharey=other`` when constructing the
1315 Axes, and cannot be used if the y-axis is already being shared with
1316 another Axes. Note that it is not possible to unshare axes.
1317 """
1318 _api.check_isinstance(_AxesBase, other=other)
1319 if self._sharey is not None and other is not self._sharey:
1320 raise ValueError("y-axis is already shared")
1321 self._shared_axes["y"].join(self, other)
1322 self._sharey = other
1323 self.yaxis.major = other.yaxis.major # Ticker instances holding
1324 self.yaxis.minor = other.yaxis.minor # locator and formatter.
1325 y0, y1 = other.get_ylim()
1326 self.set_ylim(y0, y1, emit=False, auto=other.get_autoscaley_on())
1327 self.yaxis._scale = other.yaxis._scale
1328
1329 def __clear(self):
1330 """Clear the Axes."""

Callers 3

subplot_mosaicMethod · 0.80
psd_demo.pyFile · 0.80

Calls 3

set_ylimMethod · 0.95
joinMethod · 0.80
get_ylimMethod · 0.45

Tested by 1