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

Function test_label_loc_rc

lib/matplotlib/tests/test_axes.py:119–136  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

117
118@check_figures_equal()
119def test_label_loc_rc(fig_test, fig_ref):
120 with matplotlib.rc_context({"xaxis.labellocation": "right",
121 "yaxis.labellocation": "top"}):
122 ax = fig_test.subplots()
123 sc = ax.scatter([1, 2], [1, 2], c=[1, 2], label='scatter')
124 ax.legend()
125 ax.set_ylabel('Y Label')
126 ax.set_xlabel('X Label')
127 cbar = fig_test.colorbar(sc, orientation='horizontal')
128 cbar.set_label("Z Label")
129
130 ax = fig_ref.subplots()
131 sc = ax.scatter([1, 2], [1, 2], c=[1, 2], label='scatter')
132 ax.legend()
133 ax.set_ylabel('Y Label', y=1, ha='right')
134 ax.set_xlabel('X Label', x=1, ha='right')
135 cbar = fig_ref.colorbar(sc, orientation='horizontal')
136 cbar.set_label("Z Label", x=1, ha='right')
137
138
139def test_label_shift():

Callers

nothing calls this directly

Calls 7

set_ylabelMethod · 0.80
set_xlabelMethod · 0.80
subplotsMethod · 0.45
scatterMethod · 0.45
legendMethod · 0.45
colorbarMethod · 0.45
set_labelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…