Skip to content

Commit 804bd66

Browse files
committed
Fix test related to sharing
1 parent c88fedb commit 804bd66

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,8 +1336,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
13361336
and aspect in ('equal', 'auto')):
13371337
aspect = float(aspect) # raise ValueError if necessary
13381338
if share:
1339-
axes = set(self._shared_x_axes.get_siblings(self)
1340-
+ self._shared_y_axes.get_siblings(self))
1339+
axes = set(self._shared_x_axes | self._shared_y_axes)
13411340
else:
13421341
axes = [self]
13431342
for ax in axes:
@@ -4308,7 +4307,7 @@ def _share_axes(self, axes, shared_axes):
43084307

43094308
for ax in shared:
43104309
setattr(ax, shared_axes, shared)
4311-
ax._adjustable = 'datalim'
4310+
# ax._adjustable = 'datalim'
43124311

43134312
def share_x_axes(self, axes):
43144313
"""

lib/matplotlib/tests/test_subplots.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ def check_shared(axs, x_shared, y_shared):
1919
enumerate(zip("xy", [x_shared, y_shared]))):
2020
if i2 <= i1:
2121
continue
22+
share = getattr(ax1, "_shared_{}_axes".format(name))
23+
share = ax2 in share
2224
assert \
23-
(getattr(axs[0], "_shared_{}_axes".format(name)).joined(ax1, ax2)
25+
(share
2426
== shared[i1, i2]), \
2527
"axes %i and %i incorrectly %ssharing %s axis" % (
2628
i1, i2, "not " if shared[i1, i2] else "", name)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy