Skip to content

Commit 0f4e99d

Browse files
authored
Use canonical name for set_horizonalalignment over alias set_ha (#7786)
1 parent 7c53a94 commit 0f4e99d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xarray/plot/dataarray_plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def line(
530530
if np.issubdtype(xplt.dtype, np.datetime64):
531531
for xlabels in ax.get_xticklabels():
532532
xlabels.set_rotation(30)
533-
xlabels.set_ha("right")
533+
xlabels.set_horizontalalignment("right")
534534

535535
_update_axes(ax, xincrease, yincrease, xscale, yscale, xticks, yticks, xlim, ylim)
536536

@@ -1099,7 +1099,7 @@ def _add_labels(
10991099
# https://stackoverflow.com/questions/17430105/autofmt-xdate-deletes-x-axis-labels-of-all-subplots
11001100
for labels in getattr(ax, f"get_{axis}ticklabels")():
11011101
labels.set_rotation(30)
1102-
labels.set_ha("right")
1102+
labels.set_horizontalalignment("right")
11031103

11041104

11051105
@overload
@@ -1639,7 +1639,7 @@ def newplotfunc(
16391639
if np.issubdtype(xplt.dtype, np.datetime64):
16401640
for xlabels in ax.get_xticklabels():
16411641
xlabels.set_rotation(30)
1642-
xlabels.set_ha("right")
1642+
xlabels.set_horizontalalignment("right")
16431643

16441644
return primitive
16451645

0 commit comments

Comments
 (0)