Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ac96eb

Browse filesBrowse files
committed
Define autoscale() based on autoscale_None().
They're the same if autoscale() first resets vmin/vmax to None. This ensures e.g. that the exact semantics of fully invalid arrays (in_trf_range is empty) for make_norm_from_scale are consistent between the two methods.
1 parent d09526f commit 3ac96eb
Copy full SHA for 3ac96eb

File tree

Expand file treeCollapse file tree

1 file changed

+3
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-10
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+3-10Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,9 +1371,8 @@ def inverse(self, value):
13711371

13721372
def autoscale(self, A):
13731373
"""Set *vmin*, *vmax* to min, max of *A*."""
1374-
A = np.asanyarray(A)
1375-
self.vmin = A.min()
1376-
self.vmax = A.max()
1374+
self.vmin = self.vmax = None
1375+
self.autoscale_None(A)
13771376

13781377
def autoscale_None(self, A):
13791378
"""If vmin or vmax are not set, use the min/max of *A* to set them."""
@@ -1715,14 +1714,8 @@ def inverse(self, value):
17151714
.reshape(np.shape(value)))
17161715
return value[0] if is_scalar else value
17171716

1718-
def autoscale(self, A):
1719-
# i.e. A[np.isfinite(...)], but also for non-array A's
1720-
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
1721-
if in_trf_domain.size == 0:
1722-
in_trf_domain = np.ma.masked
1723-
return super().autoscale(in_trf_domain)
1724-
17251717
def autoscale_None(self, A):
1718+
# i.e. A[np.isfinite(...)], but also for non-array A's
17261719
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
17271720
if in_trf_domain.size == 0:
17281721
in_trf_domain = np.ma.masked

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.