-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: image respect norm limits w/ None #11047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: image respect norm limits w/ None #11047
Conversation
lib/matplotlib/image.py
Outdated
a_max = np.float64(newmax) | ||
if newmax is not None or newmin is not None: | ||
A_scaled = np.clip(A_scaled, newmin, newmax) | ||
vmin = self.norm.vmin if self.norm.vmin is not None else a_min |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do if self.norm.vmin is None or self.norm.vmax is None: self.norm.autoscale_None(A)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - its OK to modify the norm here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't even need the if-statement in that case.
9d17f6f
to
023ddb8
Compare
Ping @tacaswell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash before merging.
023ddb8
to
918c8a5
Compare
squashed and rebased.... |
918c8a5
to
8d53a8a
Compare
There seem to be a conflict, please backport manually |
Does this want a backport to |
…rm-limits FIX: image respect norm limits w/ None Conflicts: lib/matplotlib/image.py - keep changes backported from master. Looks like conflict was due to some white-space clean up done on master.
backported to v2.2.x as faf9684 |
PR Summary
Re-closes #10072
We are slowly suqishing the "big number" bugs in imshow.
This one was caused by only specifying
vmax
but notvmin
. Algorithm is the same as before, but ifvmin
isNone
, then we scale bya_min
.Before
After
PR Checklist