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

Function test_title_pad

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

Source from the content-addressed store, hash-verified

7466
7467
7468def test_title_pad():
7469 # check that title padding puts the title in the right
7470 # place...
7471 fig, ax = plt.subplots()
7472 ax.set_title('aardvark', pad=30.)
7473 m = ax.titleOffsetTrans.get_matrix()
7474 assert m[1, -1] == (30. / 72. * fig.dpi)
7475 ax.set_title('aardvark', pad=0.)
7476 m = ax.titleOffsetTrans.get_matrix()
7477 assert m[1, -1] == 0.
7478 # check that it is reverted...
7479 ax.set_title('aardvark', pad=None)
7480 m = ax.titleOffsetTrans.get_matrix()
7481 assert m[1, -1] == (matplotlib.rcParams['axes.titlepad'] / 72. * fig.dpi)
7482
7483
7484def test_title_location_roundtrip():

Callers

nothing calls this directly

Calls 3

subplotsMethod · 0.45
set_titleMethod · 0.45
get_matrixMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…