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

Function test_tick_param_label_rotation

lib/matplotlib/tests/test_axes.py:8042–8062  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8040
8041
8042def test_tick_param_label_rotation():
8043 fix, (ax, ax2) = plt.subplots(1, 2)
8044 ax.plot([0, 1], [0, 1])
8045 ax2.plot([0, 1], [0, 1])
8046 ax.xaxis.set_tick_params(which='both', rotation=75)
8047 ax.yaxis.set_tick_params(which='both', rotation=90)
8048 for text in ax.get_xticklabels(which='both'):
8049 assert text.get_rotation() == 75
8050 assert text.get_rotation_mode() == 'default'
8051 for text in ax.get_yticklabels(which='both'):
8052 assert text.get_rotation() == 90
8053 assert text.get_rotation_mode() == 'default'
8054
8055 ax2.tick_params(axis='x', labelrotation=53, labelrotation_mode='xtick')
8056 ax2.tick_params(axis='y', rotation=35, rotation_mode='ytick')
8057 for text in ax2.get_xticklabels(which='major'):
8058 assert text.get_rotation() == 53
8059 assert text.get_rotation_mode() == 'xtick'
8060 for text in ax2.get_yticklabels(which='major'):
8061 assert text.get_rotation() == 35
8062 assert text.get_rotation_mode() == 'ytick'
8063
8064
8065@mpl.style.context('default')

Callers

nothing calls this directly

Calls 6

set_tick_paramsMethod · 0.80
get_rotation_modeMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
get_rotationMethod · 0.45
tick_paramsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…