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

Method sharex

lib/matplotlib/axes/_base.py:1291–1308  ·  view source on GitHub ↗

Share the x-axis with *other*. This is equivalent to passing ``sharex=other`` when constructing the Axes, and cannot be used if the x-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

1289 for side in ['left', 'right', 'bottom', 'top']}
1290
1291 def sharex(self, other):
1292 """
1293 Share the x-axis with *other*.
1294
1295 This is equivalent to passing ``sharex=other`` when constructing the
1296 Axes, and cannot be used if the x-axis is already being shared with
1297 another Axes. Note that it is not possible to unshare axes.
1298 """
1299 _api.check_isinstance(_AxesBase, other=other)
1300 if self._sharex is not None and other is not self._sharex:
1301 raise ValueError("x-axis is already shared")
1302 self._shared_axes["x"].join(self, other)
1303 self._sharex = other
1304 self.xaxis.major = other.xaxis.major # Ticker instances holding
1305 self.xaxis.minor = other.xaxis.minor # locator and formatter.
1306 x0, x1 = other.get_xlim()
1307 self.set_xlim(x0, x1, emit=False, auto=other.get_autoscalex_on())
1308 self.xaxis._scale = other.xaxis._scale
1309
1310 def sharey(self, other):
1311 """

Callers 4

subplot_mosaicMethod · 0.80
psd_demo.pyFile · 0.80
subplots_demo.pyFile · 0.80

Calls 3

set_xlimMethod · 0.95
joinMethod · 0.80
get_xlimMethod · 0.45

Tested by 1