Skip to content

Commit 7323101

Browse files
authored
minor fix for mpl3.10 (#229)
- Get the long axis for colorbar based on the new api
1 parent ce70f44 commit 7323101

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ultraplot/axes/base.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,14 @@ def _add_colorbar(
13491349

13501350
kw_label.update({"rotation": labelrotation})
13511351
axis.label.update(kw_label)
1352-
# Assume ticks are set on the long axis(!)
1353-
for label in obj._long_axis().get_ticklabels():
1352+
# Assume ticks are set on the long axis(!))
1353+
if hasattr(obj, "_long_axis"):
1354+
# mpl <=3.9
1355+
longaxis = obj._long_axis()
1356+
else:
1357+
# mpl >=3.10
1358+
longaxis = obj.long_axis
1359+
for label in longaxis.get_ticklabels():
13541360
label.update(kw_ticklabels)
13551361
kw_outline = {"edgecolor": color, "linewidth": linewidth}
13561362
if obj.outline is not None:

0 commit comments

Comments
 (0)