Skip to content

Commit 85c06cf

Browse files
authored
Merge pull request #24460 from anntzer/an
Define autoscale() based on autoscale_None().
2 parents 218cdff + 3ac96eb commit 85c06cf

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/matplotlib/colors.py

+3-10
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)