Skip to content

Commit

Permalink
Use canonical name for set_horizonalalignment over alias set_ha (#7786)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksunden committed Apr 26, 2023
1 parent 7c53a94 commit 0f4e99d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xarray/plot/dataarray_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def line(
if np.issubdtype(xplt.dtype, np.datetime64):
for xlabels in ax.get_xticklabels():
xlabels.set_rotation(30)
xlabels.set_ha("right")
xlabels.set_horizontalalignment("right")

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

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


@overload
Expand Down Expand Up @@ -1639,7 +1639,7 @@ def newplotfunc(
if np.issubdtype(xplt.dtype, np.datetime64):
for xlabels in ax.get_xticklabels():
xlabels.set_rotation(30)
xlabels.set_ha("right")
xlabels.set_horizontalalignment("right")

return primitive

Expand Down

0 comments on commit 0f4e99d

Please sign in to comment.