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

Function test_set_position

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

Source from the content-addressed store, hash-verified

8429
8430
8431def test_set_position():
8432 fig, ax = plt.subplots()
8433 ax.set_aspect(3.)
8434 ax.set_position([0.1, 0.1, 0.4, 0.4], which='both')
8435 assert np.allclose(ax.get_position().width, 0.1)
8436 ax.set_aspect(2.)
8437 ax.set_position([0.1, 0.1, 0.4, 0.4], which='original')
8438 assert np.allclose(ax.get_position().width, 0.15)
8439 ax.set_aspect(3.)
8440 ax.set_position([0.1, 0.1, 0.4, 0.4], which='active')
8441 assert np.allclose(ax.get_position().width, 0.1)
8442
8443
8444def test_spines_properbbox_after_zoom():

Callers

nothing calls this directly

Calls 5

allcloseMethod · 0.80
subplotsMethod · 0.45
set_aspectMethod · 0.45
set_positionMethod · 0.45
get_positionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…