@@ -2047,19 +2047,15 @@ def _update_offset_text_position(self, bboxes, bboxes2):
20472047 else :
20482048 bbox = mtransforms .Bbox .union (bboxes )
20492049 bottom = bbox .y0
2050- self .offsetText .set_position (
2051- (x , bottom - self .OFFSETTEXTPAD * self .figure .dpi / 72 )
2052- )
2050+ y = bottom - self .OFFSETTEXTPAD * self .figure .dpi / 72
20532051 else :
20542052 if not len (bboxes2 ):
20552053 top = self .axes .bbox .ymax
20562054 else :
20572055 bbox = mtransforms .Bbox .union (bboxes2 )
20582056 top = bbox .y1
2059- self .offsetText .set_va ('top' )
2060- self .offsetText .set_position (
2061- (x , top + self .OFFSETTEXTPAD * self .figure .dpi / 72 )
2062- )
2057+ y = top + self .OFFSETTEXTPAD * self .figure .dpi / 72
2058+ self .offsetText .set_position ((x , y ))
20632059
20642060 def get_text_heights (self , renderer ):
20652061 """
@@ -2102,10 +2098,12 @@ def set_ticks_position(self, position):
21022098 self .set_tick_params (which = 'both' , top = True , labeltop = True ,
21032099 bottom = False , labelbottom = False )
21042100 self ._tick_position = 'top'
2101+ self .offsetText .set_verticalalignment ('bottom' )
21052102 elif position == 'bottom' :
21062103 self .set_tick_params (which = 'both' , top = False , labeltop = False ,
21072104 bottom = True , labelbottom = True )
21082105 self ._tick_position = 'bottom'
2106+ self .offsetText .set_verticalalignment ('top' )
21092107 elif position == 'both' :
21102108 self .set_tick_params (which = 'both' , top = True ,
21112109 bottom = True )
@@ -2116,6 +2114,7 @@ def set_ticks_position(self, position):
21162114 self .set_tick_params (which = 'both' , top = True , labeltop = False ,
21172115 bottom = True , labelbottom = True )
21182116 self ._tick_position = 'bottom'
2117+ self .offsetText .set_verticalalignment ('top' )
21192118 else :
21202119 assert False , "unhandled parameter not caught by _check_in_list"
21212120 self .stale = True
0 commit comments