File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -537,3 +537,26 @@ def test_align_labels():
537537 after_align [1 ].x0 , rtol = 0 , atol = 1e-05 )
538538 # ensure labels do not go off the edge
539539 assert after_align [0 ].x0 >= 1
540+
541+
542+ def test_suplabels ():
543+ fig , ax = plt .subplots (constrained_layout = True )
544+ fig .draw_no_output ()
545+ pos0 = ax .get_tightbbox (fig .canvas .get_renderer ())
546+ fig .supxlabel ('Boo' )
547+ fig .supylabel ('Booy' )
548+ fig .draw_no_output ()
549+ pos = ax .get_tightbbox (fig .canvas .get_renderer ())
550+ assert pos .y0 > pos0 .y0 + 10.0
551+ assert pos .x0 > pos0 .x0 + 10.0
552+
553+ fig , ax = plt .subplots (constrained_layout = True )
554+ fig .draw_no_output ()
555+ pos0 = ax .get_tightbbox (fig .canvas .get_renderer ())
556+ # check that specifying x (y) doesn't ruin the layout
557+ fig .supxlabel ('Boo' , x = 0.5 )
558+ fig .supylabel ('Boo' , y = 0.5 )
559+ fig .draw_no_output ()
560+ pos = ax .get_tightbbox (fig .canvas .get_renderer ())
561+ assert pos .y0 > pos0 .y0 + 10.0
562+ assert pos .x0 > pos0 .x0 + 10.0
You can’t perform that action at this time.
0 commit comments