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

Function check_ticklabel_visible

lib/matplotlib/tests/test_subplots.py:29–43  ·  view source on GitHub ↗

Check that the x and y ticklabel visibility is as specified.

(axs, x_visible, y_visible)

Source from the content-addressed store, hash-verified

27
28
29def check_ticklabel_visible(axs, x_visible, y_visible):
30 """Check that the x and y ticklabel visibility is as specified."""
31 for i, (ax, vx, vy) in enumerate(zip(axs, x_visible, y_visible)):
32 for l in ax.get_xticklabels() + [ax.xaxis.offsetText]:
33 assert l.get_visible() == vx, \
34 f"Visibility of x axis #{i} is incorrectly {vx}"
35 for l in ax.get_yticklabels() + [ax.yaxis.offsetText]:
36 assert l.get_visible() == vy, \
37 f"Visibility of y axis #{i} is incorrectly {vy}"
38 # axis label "visibility" is toggled by label_outer by resetting the
39 # label to empty, but it can also be empty to start with.
40 if not vx:
41 assert ax.get_xlabel() == ""
42 if not vy:
43 assert ax.get_ylabel() == ""
44
45
46def check_tick1_visible(axs, x_visible, y_visible):

Callers 5

test_sharedFunction · 0.85
test_label_outerFunction · 0.85
test_label_outer_spanFunction · 0.85
test_shared_and_movedFunction · 0.85

Calls 3

get_xlabelMethod · 0.80
get_ylabelMethod · 0.80
get_visibleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…