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

Function test_xtick_rotation_mode

lib/matplotlib/tests/test_text.py:1156–1171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1154
1155@image_comparison(['xtick_rotation_mode.png'], remove_text=False, style='mpl20')
1156def test_xtick_rotation_mode():
1157 fig, ax = plt.subplots(figsize=(12, 1))
1158 ax.set_yticks([])
1159 ax2 = ax.twiny()
1160
1161 ax.set_xticks(range(37), ['foo'] * 37, rotation_mode="xtick")
1162 ax2.set_xticks(range(37), ['foo'] * 37, rotation_mode="xtick")
1163
1164 angles = np.linspace(0, 360, 37)
1165
1166 for tick, angle in zip(ax.get_xticklabels(), angles):
1167 tick.set_rotation(angle)
1168 for tick, angle in zip(ax2.get_xticklabels(), angles):
1169 tick.set_rotation(angle)
1170
1171 plt.subplots_adjust(left=0.01, right=0.99, top=.6, bottom=.4)
1172
1173
1174@image_comparison(['ytick_rotation_mode.png'], remove_text=False, style='mpl20')

Callers

nothing calls this directly

Calls 6

set_yticksMethod · 0.80
set_xticksMethod · 0.80
set_rotationMethod · 0.80
subplots_adjustMethod · 0.80
subplotsMethod · 0.45
twinyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…