8000 avoid implicit np.array -> float conversion · brunobeltran/matplotlib@40f58b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 40f58b0

Browse files
committed
avoid implicit np.array -> float conversion
1 parent f650bf8 commit 40f58b0

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
@@ -739,7 +739,8 @@ def format_data_short(self, value):
739739
delta = abs(neighbor_values - value).max()
740740
else:
741741
# Rough approximation: no more than 1e4 divisions.
742-
delta = np.diff(self.axis.get_view_interval()) / 1e4
742+
a, b = self.axis.get_view_interval()
743+
delta = (b - a) / 1e4
743744
# If e.g. value = 45.67 and delta = 0.02, then we want to round to
744745
# 2 digits after the decimal point (floor(log10(0.02)) = -2);
745746
# 45.67 contributes 2 digits before the decimal point

0 commit comments

Comments
 (0)
0