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)
| 11 | |
| 12 | |
| 13 | def 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 | |
| 29 | def check_ticklabel_visible(axs, x_visible, y_visible): |
no test coverage detected
searching dependent graphs…