@@ -731,6 +731,8 @@ def suptitle(self, t, **kwargs):
731
731
732
732
>>> fig.suptitle('This is the figure title', fontsize=12)
733
733
"""
734
+ manual_position = ('x' in kwargs or 'y' in kwargs )
735
+
734
736
x = kwargs .pop ('x' , 0.5 )
735
737
y = kwargs .pop ('y' , 0.98 )
736
738
@@ -754,17 +756,22 @@ def suptitle(self, t, **kwargs):
754
756
else :
755
757
self ._suptitle = sup
756
758
if self ._layoutbox is not None :
757
- figlb = self ._layoutbox
758
- self ._suptitle ._layoutbox = layoutbox .LayoutBox (
759
- parent = figlb ,
759
+ if not manual_position :
760
+ figlb = self ._layoutbox
761
+ self ._suptitle ._layoutbox = \
762
+ layoutbox .LayoutBox (parent = figlb ,
760
763
name = figlb .name + '.suptitle' )
761
- for child in figlb .children :
762
- if not (child == self ._suptitle ._layoutbox ):
763
- w_pad , h_pad , wspace , hspace = \
764
- self .get_constrained_layout_pads (
765
- relative = True )
766
- layoutbox .vstack ([self ._suptitle ._layoutbox , child ],
767
- padding = h_pad * 2. , strength = 'required' )
764
+ for child in figlb .children :
765
+ if not (child == self ._suptitle ._layoutbox ):
766
+ w_pad , h_pad , wspace , hspace = \
767
+ self .get_constrained_layout_pads (
768
+ relative = True )
769
+ layoutbox .vstack ([self ._suptitle ._layoutbox ,
770
+ child ],
771
+ padding = h_pad * 2. ,
772
+ strength = 'required' )
773
+ else :
774
+ self ._suptitle ._layoutbox = None
768
775
self .stale = True
769
776
return self ._suptitle
770
777
0 commit comments