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

Function check_shared

lib/matplotlib/tests/test_subplots.py:13–26  ·  view source on GitHub ↗

x_shared and y_shared are n x n boolean matrices; entry (i, j) indicates whether the x (or y) axes of subplots i and j should be shared.

(axs, x_shared, y_shared)

Source from the content-addressed store, hash-verified

11
12
13def check_shared(axs, x_shared, y_shared):
14 """
15 x_shared and y_shared are n x n boolean matrices; entry (i, j) indicates
16 whether the x (or y) axes of subplots i and j should be shared.
17 """
18 for (i1, ax1), (i2, ax2), (i3, (name, shared)) in itertools.product(
19 enumerate(axs),
20 enumerate(axs),
21 enumerate(zip("xy", [x_shared, y_shared]))):
22 if i2 <= i1:
23 continue
24 assert axs[0]._shared_axes[name].joined(ax1, ax2) == shared[i1, i2], \
25 "axes %i and %i incorrectly %ssharing %s axis" % (
26 i1, i2, "not " if shared[i1, i2] else "", name)
27
28
29def check_ticklabel_visible(axs, x_visible, y_visible):

Callers 1

test_sharedFunction · 0.85

Calls 1

joinedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…