8000 Handle axis instances even if they don't have a __name__. · matplotlib/matplotlib@b6bdcd1 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6bdcd1

Browse files
committed
Handle axis instances even if they don't have a __name__.
1 parent d9bf0be commit b6bdcd1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/ticker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,8 @@ def format_data_short(self, value):
695695
if isinstance(value, Integral):
696696
fmt = "%d"
697697
else:
698-
if self.axis.__name__ in ["xaxis", "yaxis"]:
698+
if (hasattr(self.axis, '__name__') and
699+
self.axis.__name__ in ["xaxis", "yaxis"]):
699700
if self.axis.__name__ == "xaxis":
700701
axis_trf = self.axis.axes.get_xaxis_transform()
701702
axis_inv_trf = axis_trf.inverted()

0 commit comments

Comments
 (0)
0