@@ -2952,15 +2952,6 @@ def _update_title_position(self, renderer):
2952
2952
2953
2953
titles = []
2954
2954
2955
- # Get grouped axes for alignment if align_titles was previously called
2956
- # grouped_axs = self.figure._align_title_groups.get_siblings(self)
2957
- # if(grouped_axs is not None):
2958
- # titles = []
2959
- # for ax in grouped_axs:
2960
- # titles.extend([ax.title, ax._left_title, ax._right_title])
2961
- # else:
2962
- # titles = [self.title, self._left_title, self._right_title]
2963
-
2964
2955
titles = [self .title , self ._left_title , self ._right_title ]
2965
2956
2966
2957
for title in titles :
@@ -3014,12 +3005,24 @@ def _update_title_position(self, renderer):
3014
3005
title .set_position ((x , y ))
3015
3006
3016
3007
ymax = max (title .get_position ()[1 ] for title in titles )
3017
- # TODO: and for titles in sibling axes according to grouper
3018
3008
for title in titles :
3019
3009
# now line up all the titles at the highest baseline.
3020
3010
x , _ = title .get_position ()
3021
3011
title .set_position ((x , ymax ))
3022
3012
3013
+ # Assign
3014
+ grouped_axs = self .figure ._align_title_groups .get_siblings (self )
3015
+ ymax = None
3016
+ ax_max = None
3017
+ for ax in grouped_axs :
3018
+ if ymax is None or ax .bbox .ymax > ymax :
3019
+ ymax = ax .bbox .ymax
3020
+ ax_max = ax
3021
+ # print("SELF FIRST: ", self.bbox.xmax)
3022
+ # print("OTHER: ", ax_max.bbox.xmax)
3023
+ self .bbox = ax_max .bbox
3024
+ # print("SELF AFTER: ", self.bbox.xmax)
3025
+
3023
3026
# Drawing
3024
3027
@martist .allow_rasterization
3025
3028
def draw (self , renderer ):
0 commit comments