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

Function test_rect

lib/matplotlib/tests/test_constrainedlayout.py:615–630  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

613
614
615def test_rect():
616 fig, ax = plt.subplots(layout='constrained')
617 fig.get_layout_engine().set(rect=[0, 0, 0.5, 0.5])
618 fig.draw_without_rendering()
619 ppos = ax.get_position()
620 assert ppos.x1 < 0.5
621 assert ppos.y1 < 0.5
622
623 fig, ax = plt.subplots(layout='constrained')
624 fig.get_layout_engine().set(rect=[0.2, 0.2, 0.3, 0.3])
625 fig.draw_without_rendering()
626 ppos = ax.get_position()
627 assert ppos.x1 < 0.5
628 assert ppos.y1 < 0.5
629 assert ppos.x0 > 0.2
630 assert ppos.y0 > 0.2
631
632
633def test_compressed1():

Callers

nothing calls this directly

Calls 5

subplotsMethod · 0.45
setMethod · 0.45
get_layout_engineMethod · 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…