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

Function test_tick_not_in_layout

lib/matplotlib/tests/test_axis.py:36–47  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

34
35@check_figures_equal()
36def test_tick_not_in_layout(fig_test, fig_ref):
37 # Check that the "very long" ticklabel is ignored from layouting after
38 # set_in_layout(False); i.e. the layout is as if the ticklabel was empty.
39 # Ticklabels are set to white so that the actual string doesn't matter.
40 fig_test.set_layout_engine("constrained")
41 ax = fig_test.add_subplot(xticks=[0, 1], xticklabels=["short", "very long"])
42 ax.tick_params(labelcolor="w")
43 fig_test.draw_without_rendering() # Ensure ticks are correct.
44 ax.xaxis.majorTicks[-1].label1.set_in_layout(False)
45 fig_ref.set_layout_engine("constrained")
46 ax = fig_ref.add_subplot(xticks=[0, 1], xticklabels=["short", ""])
47 ax.tick_params(labelcolor="w")
48
49
50def test_translate_tick_params_reverse():

Callers

nothing calls this directly

Calls 5

set_layout_engineMethod · 0.80
add_subplotMethod · 0.80
set_in_layoutMethod · 0.80
tick_paramsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…