@@ -8154,11 +8154,11 @@ def test_bar_label_location_vertical():
8154
8154
rects = ax .bar (xs , heights )
8155
8155
labels = ax .bar_label (rects )
8156
8156
assert labels [0 ].xy == (xs [0 ], heights [0 ])
8157
- assert labels [0 ].get_ha () == 'center'
8158
- assert labels [0 ].get_va () == 'bottom'
8157
+ assert labels [0 ].get_horizontalalignment () == 'center'
8158
+ assert labels [0 ].get_verticalalignment () == 'bottom'
8159
8159
assert labels [1 ].xy == (xs [1 ], heights [1 ])
8160
- assert labels [1 ].get_ha () == 'center'
8161
- assert labels [1 ].get_va () == 'top'
8160
+ assert labels [1 ].get_horizontalalignment () == 'center'
8161
+ assert labels [1 ].get_verticalalignment () == 'top'
8162
8162
8163
8163
8164
8164
def test_bar_label_location_vertical_yinverted ():
@@ -8168,11 +8168,11 @@ def test_bar_label_location_vertical_yinverted():
8168
8168
rects = ax .bar (xs , heights )
8169
8169
labels = ax .bar_label (rects )
8170
8170
assert labels [0 ].xy == (xs [0 ], heights [0 ])
8171
- assert labels [0 ].get_ha () == 'center'
8172
- assert labels [0 ].get_va () == 'top'
8171
+ assert labels [0 ].get_horizontalalignment () == 'center'
8172
+ assert labels [0 ].get_verticalalignment () == 'top'
8173
8173
assert labels [1 ].xy == (xs [1 ], heights [1 ])
8174
- assert labels [1 ].get_ha () == 'center'
8175
- assert labels [1 ].get_va () == 'bottom'
8174
+ assert labels [1 ].get_horizontalalignment () == 'center'
8175
+ assert labels [1 ].get_verticalalignment () == 'bottom'
8176
8176
8177
8177
8178
8178
def test_bar_label_location_horizontal ():
@@ -8181,11 +8181,11 @@ def test_bar_label_location_horizontal():
8181
8181
rects = ax .barh (ys , widths )
8182
8182
labels = ax .bar_label (rects )
8183
8183
assert labels [0 ].xy == (widths [0 ], ys [0 ])
8184
- assert labels [0 ].get_ha () == 'left'
8185
- assert labels [0 ].get_va () == 'center'
8184
+ assert labels [0 ].get_horizontalalignment () == 'left'
8185
+ assert labels [0 ].get_verticalalignment () == 'center'
8186
8186
assert labels [1 ].xy == (widths [1 ], ys [1 ])
8187
- assert labels [1 ].get_ha () == 'right'
8188
- assert labels [1 ].get_va () == 'center'
8187
+ assert labels [1 ].get_horizontalalignment () == 'right'
8188
+ assert labels [1 ].get_verticalalignment () == 'center'
8189
8189
8190
8190
8191
8191
def test_bar_label_location_horizontal_yinverted ():
@@ -8195,11 +8195,11 @@ def test_bar_label_location_horizontal_yinverted():
8195
8195
rects = ax .barh (ys , widths )
8196
8196
labels = ax .bar_label (rects )
8197
8197
assert labels [0 ].xy == (widths [0 ], ys [0 ])
8198
- assert labels [0 ].get_ha () == 'left'
8199
- assert labels [0 ].get_va () == 'center'
8198
+ assert labels [0 ].get_horizontalalignment () == 'left'
8199
+ assert labels [0 ].get_verticalalignment () == 'center'
8200
8200
assert labels [1 ].xy == (widths [1 ], ys [1 ])
8201
- assert labels [1 ].get_ha () == 'right'
8202
- assert labels [1 ].get_va () == 'center'
8201
+ assert labels [1 ].get_horizontalalignment () == 'right'
8202
+ assert labels [1 ].get_verticalalignment () == 'center'
8203
8203
8204
8204
8205
8205
def test_bar_label_location_horizontal_xinverted ():
@@ -8209,11 +8209,11 @@ def test_bar_label_location_horizontal_xinverted():
8209
8209
rects = ax .barh (ys , widths )
8210
8210
labels = ax .bar_label (rects )
8211
8211
assert labels [0 ].xy == (widths [0 ], ys [0 ])
8212
- assert labels [0 ].get_ha () == 'right'
8213
- assert labels [0 ].get_va () == 'center'
8212
+ assert labels [0 ].get_horizontalalignment () == 'right'
8213
+ assert labels [0 ].get_verticalalignment () == 'center'
8214
8214
assert labels [1 ].xy == (widths [1 ], ys [1 ])
8215
- assert labels [1 ].get_ha () == 'left'
8216
- assert labels [1 ].get_va () == 'center'
8215
+ assert labels [1 ].get_horizontalalignment () == 'left'
8216
+ assert labels [1 ].get_verticalalignment () == 'center'
8217
8217
8218
8218
8219
8219
def test_bar_label_location_horizontal_xyinverted ():
@@ -8224,11 +8224,11 @@ def test_bar_label_location_horizontal_xyinverted():
8224
8224
rects = ax .barh (ys , widths )
8225
8225
labels = ax .bar_label (rects )
8226
8226
assert labels [0 ].xy == (widths [0 ], ys [0 ])
8227
- assert labels [0 ].get_ha () == 'right'
8228
- assert labels [0 ].get_va () == 'center'
8227
+ assert labels [0 ].get_horizontalalignment () == 'right'
8228
+ assert labels [0 ].get_verticalalignment () == 'center'
8229
8229
assert labels [1 ].xy == (widths [1 ], ys [1 ])
8230
- assert labels [1 ].get_ha () == 'left'
8231
- assert labels [1 ].get_va () == 'center'
8230
+ assert labels [1 ].get_horizontalalignment () == 'left'
8231
+ assert labels [1 ].get_verticalalignment () == 'center'
8232
8232
8233
8233
8234
8234
def test_bar_label_location_center ():
@@ -8237,11 +8237,11 @@ def test_bar_label_location_center():
8237
8237
rects = ax .barh (ys , widths )
8238
8238
labels = ax .bar_label (rects , label_type = 'center' )
8239
8239
assert labels [0 ].xy == (0.5 , 0.5 )
8240
- assert labels [0 ].get_ha () == 'center'
8241
- assert labels [0 ].get_va () == 'center'
8240
+ assert labels [0 ].get_horizontalalignment () == 'center'
8241
+ assert labels [0 ].get_verticalalignment () == 'center'
8242
8242
assert labels [1 ].xy == (0.5 , 0.5 )
8243
- assert labels [1 ].get_ha () == 'center'
8244
- assert labels [1 ].get_va () == 'center'
8243
+ assert labels [1 ].get_horizontalalignment () == 'center'
8244
+ assert labels [1 ].get_verticalalignment () == 'center'
8245
8245
8246
8246
8247
8247
@image_comparison (['test_centered_bar_label_nonlinear.svg' ])
@@ -8273,11 +8273,11 @@ def test_bar_label_location_errorbars():
8273
8273
rects = ax .bar (xs , heights , yerr = 1 )
8274
8274
labels = ax .bar_label (rects )
8275
8275
assert labels [0 ].xy == (xs [0 ], heights [0 ] + 1 )
8276
- assert labels [0 ].get_ha () == 'center'
8277
- assert labels [0 ].get_va () == 'bottom'
8276
+ assert labels [0 ].get_horizontalalignment () == 'center'
8277
+ assert labels [0 ].get_verticalalignment () == 'bottom'
8278
8278
assert labels [1 ].xy == (xs [1 ], heights [1 ] - 1 )
8279
- assert labels [1 ].get_ha () == 'center'
8280
- assert labels [1 ].get_va () == 'top'
8279
+ assert labels [1 ].get_horizontalalignment () == 'center'
8280
+ assert labels [1 ].get_verticalalignment () == 'top'
8281
8281
8282
8282
8283
8283
@pytest .mark .parametrize ('fmt' , [
@@ -8312,7 +8312,7 @@ def test_bar_label_nan_ydata():
8312
8312
labels = ax .bar_label (bars )
8313
8313
assert [l .get_text () for l in labels ] == ['' , '1' ]
8314
8314
assert labels [0 ].xy == (2 , 0 )
8315
- assert labels [0 ].get_va () == 'bottom'
8315
+ assert labels [0 ].get_verticalalignment () == 'bottom'
8316
8316
8317
8317
8318
8318
def test_bar_label_nan_ydata_inverted ():
@@ -8322,7 +8322,7 @@ def test_bar_label_nan_ydata_inverted():
8322
8322
labels = ax .bar_label (bars )
8323
8323
assert [l .get_text () for l in labels ] == ['' , '1' ]
8324
8324
assert labels [0 ].xy == (2 , 0 )
8325
- assert labels [0 ].get_va () == 'bottom'
8325
+ assert labels [0 ].get_verticalalignment () == 'bottom'
8326
8326
8327
8327
8328
8328
def test_nan_barlabels ():
0 commit comments