Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9a585d

Browse files
committed
test subplots use symmetric, transitive share.
1 parent 837723f commit c9a585d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/tests/test_subplots.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ 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(ax2, "_shared_{}_axes".format(name))
23-
share = ax1 in share
22+
# symmetric share
23+
shareA = getattr(ax1, "_shared_{}_axes".format(name))
24+
shareA = ax2 in shareA
25+
shareB = getattr(ax2, "_shared_{}_axes".format(name))
26+
shareB = ax1 in shareB
27+
share = shareA and shareB
2428
assert \
2529
(share
2630
== shared[i1, i2]), \

0 commit comments

Comments
 (0)