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

Function test_suplabels

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

Source from the content-addressed store, hash-verified

561
562
563def test_suplabels():
564 fig, ax = plt.subplots(layout="constrained")
565 fig.draw_without_rendering()
566 pos0 = ax.get_tightbbox(fig.canvas.get_renderer())
567 fig.supxlabel('Boo')
568 fig.supylabel('Booy')
569 fig.draw_without_rendering()
570 pos = ax.get_tightbbox(fig.canvas.get_renderer())
571 assert pos.y0 > pos0.y0 + 10.0
572 assert pos.x0 > pos0.x0 + 10.0
573
574 fig, ax = plt.subplots(layout="constrained")
575 fig.draw_without_rendering()
576 pos0 = ax.get_tightbbox(fig.canvas.get_renderer())
577 # check that specifying x (y) doesn't ruin the layout
578 fig.supxlabel('Boo', x=0.5)
579 fig.supylabel('Boo', y=0.5)
580 fig.draw_without_rendering()
581 pos = ax.get_tightbbox(fig.canvas.get_renderer())
582 assert pos.y0 > pos0.y0 + 10.0
583 assert pos.x0 > pos0.x0 + 10.0
584
585
586def test_gridspec_addressing():

Callers

nothing calls this directly

Calls 6

supxlabelMethod · 0.80
supylabelMethod · 0.80
subplotsMethod · 0.45
get_tightbboxMethod · 0.45
get_rendererMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…