@@ -658,7 +658,7 @@ def _share_long_axis(self, share, side):
658
658
def _update_title_position (self , renderer ):
659
659
"""
660
660
Update the position of proplot inset titles and builtin matplotlib
661
- titles.
661
+ titles. This is called by matplotlib at drawtime.
662
662
"""
663
663
# Custom inset titles
664
664
width , height = self .get_size_inches ()
@@ -672,20 +672,18 @@ def _update_title_position(self, renderer):
672
672
loc = self ._abc_loc
673
673
if loc in ('left' , 'right' , 'center' ):
674
674
continue
675
+ pad = rc ['axes.titlepad' ] / (72 * width )
675
676
if loc in ('upper center' , 'lower center' ):
676
677
x = 0.5
677
678
elif loc in ('upper left' , 'lower left' ):
678
- pad = rc ['axes.titlepad' ] / (72 * width )
679
- x = 1.5 * pad
679
+ x = pad
680
680
elif loc in ('upper right' , 'lower right' ):
681
- pad = rc [ 'axes.titlepad' ] / ( 72 * width )
682
- x = 1 - 1.5 * pad
681
+ x = 1 - pad
682
+ pad = rc [ 'axes.titlepad' ] / ( 72 * height )
683
683
if loc in ('upper left' , 'upper right' , 'upper center' ):
684
- pad = rc ['axes.titlepad' ] / (72 * height )
685
- y = 1 - 1.5 * pad
684
+ y = 1 - pad
686
685
elif loc in ('lower left' , 'lower right' , 'lower center' ):
687
- pad = rc ['axes.titlepad' ] / (72 * height )
688
- y = 1.5 * pad
686
+ y = pad
689
687
obj .set_position ((x , y ))
690
688
691
689
# Push title above tick marks, since builtin algorithm used to offset
0 commit comments