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

Skip to content

Commit 89c3345

Browse files
committed
FIX: image respect norm limits w/ None
1 parent ea8f80a commit 89c3345

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/image.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
390390
# float64's ability to represent changes. Applying
391391
# a norm first would be good, but ruins the interpolation
392392
# of over numbers.
393-
vmin = self.norm.vmin if self.norm.vmin is not None else a_min
394-
vmax = self.norm.vmax if self.norm.vmax is not None else a_max
395-
396-
dv = (np.float64(vmax) -
397-
np.float64(vmin))
398-
vmid = vmin + dv / 2
393+
self.norm.autoscale_None(A)
394+
dv = (np.float64(self.norm.vmax) -
395+
np.float64(self.norm.vmin))
396+
vmid = self.norm.vmin + dv / 2
399397
newmin = vmid - dv * 1.e7
400398
if newmin < a_min:
401399
newmin = None

0 commit comments

Comments
 (0)