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

Function test_title_location_roundtrip

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

Source from the content-addressed store, hash-verified

7482
7483
7484def test_title_location_roundtrip():
7485 fig, ax = plt.subplots()
7486 # set default title location
7487 plt.rcParams['axes.titlelocation'] = 'center'
7488 ax.set_title('aardvark')
7489 ax.set_title('left', loc='left')
7490 ax.set_title('right', loc='right')
7491
7492 assert 'left' == ax.get_title(loc='left')
7493 assert 'right' == ax.get_title(loc='right')
7494 assert 'aardvark' == ax.get_title(loc='center')
7495
7496 with pytest.raises(ValueError):
7497 ax.get_title(loc='foo')
7498 with pytest.raises(ValueError):
7499 ax.set_title('fail', loc='foo')
7500
7501
7502@pytest.mark.parametrize('sharex', [True, False])

Callers

nothing calls this directly

Calls 3

subplotsMethod · 0.45
set_titleMethod · 0.45
get_titleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…