@@ -2047,19 +2047,15 @@ def _update_offset_text_position(self, bboxes, bboxes2):
2047
2047
else :
2048
2048
bbox = mtransforms .Bbox .union (bboxes )
2049
2049
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
2053
2051
else :
2054
2052
if not len (bboxes2 ):
2055
2053
top = self .axes .bbox .ymax
2056
2054
else :
2057
2055
bbox = mtransforms .Bbox .union (bboxes2 )
2058
2056
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 ))
2063
2059
2064
2060
def get_text_heights (self , renderer ):
2065
2061
"""
@@ -2102,10 +2098,12 @@ def set_ticks_position(self, position):
2102
2098
self .set_tick_params (which = 'both' , top = True , labeltop = True ,
2103
2099
bottom = False , labelbottom = False )
2104
2100
self ._tick_position = 'top'
2101
+ self .offsetText .set_verticalalignment ('bottom' )
2105
2102
elif position == 'bottom' :
2106
2103
self .set_tick_params (which = 'both' , top = False , labeltop = False ,
2107
2104
bottom = True , labelbottom = True )
2108
2105
self ._tick_position = 'bottom'
2106
+ self .offsetText .set_verticalalignment ('top' )
2109
2107
elif position == 'both' :
2110
2108
self .set_tick_params (which = 'both' , top = True ,
2111
2109
bottom = True )
@@ -2116,6 +2114,7 @@ def set_ticks_position(self, position):
2116
2114
self .set_tick_params (which = 'both' , top = True , labeltop = False ,
2117
2115
bottom = True , labelbottom = True )
2118
2116
self ._tick_position = 'bottom'
2117
+ self .offsetText .set_verticalalignment ('top' )
2119
2118
else :
2120
2119
assert False , "unhandled parameter not caught by _check_in_list"
2121
2120
self .stale = True
0 commit comments