10000 Merge pull request #19952 from nschloe/np-array-float-conversions · brunobeltran/matplotlib@0151110 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0151110

Browse files
authored
Merge pull request matplotlib#19952 from nschloe/np-array-float-conversions
avoid implicit np.array -> float conversion
2 parents cc1f776 + 40f58b0 commit 0151110

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