Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f458fc4

Browse files
committed
Use more compact syntax
1 parent b6bdcd1 commit f458fc4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/ticker.py

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

0 commit comments

Comments
 (0)