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

Function test_layout_change_warning

lib/matplotlib/tests/test_figure.py:775–782  ·  view source on GitHub ↗

Raise a warning when a previously assigned layout changes to tight using plt.tight_layout().

(layout)

Source from the content-addressed store, hash-verified

773
774@pytest.mark.parametrize('layout', ['constrained', 'compressed'])
775def test_layout_change_warning(layout):
776 """
777 Raise a warning when a previously assigned layout changes to tight using
778 plt.tight_layout().
779 """
780 fig, ax = plt.subplots(layout=layout)
781 with pytest.warns(UserWarning, match='The figure layout has changed to'):
782 plt.tight_layout()
783
784
785def test_repeated_tightlayout():

Callers

nothing calls this directly

Calls 2

subplotsMethod · 0.45
tight_layoutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…