Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
scatter() should not rescale if norm is given#15769
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
c61074d toc4b1e02Compareanntzer commentedNov 24, 2019
The same piece of code exists in imshow() (with the same doc as for scatter). Does it also need to be fixed there? |
c4b1e02 to90468b0Compareanntzer commentedNov 25, 2019
There's a few others which may need the same treatment (haven't fully checked) -- hexbin, pcolor, pcolormesh, pcolorfast. Maybe worth extracting into a separate function? |
90468b0 tof0e007cComparetimhoffm commentedNov 25, 2019
This is now a private method The whole mappable initialization is a bit of a beast because the data are not part of the constructor and scaling depends on the data. Might be possible to untangle that further but that's for another PR. |
| ret=im | ||
| ifvminisnotNoneorvmaxisnotNone: | ||
| ret.set_clim(vmin,vmax) |
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.
This was actually a bug. it should have been inside thenp.dim(C) == 2 because RGB(A) data also do not need aset_clim.
anntzer commentedNov 25, 2019
Should the change in behavior (even if arguably a bugfix) be documented? |
f0e007c to813e3f1Comparetimhoffm commentedNov 25, 2019
Not sure. Do we document bugfixes? By their nature they change the behavior. But they are not an API change with respect to the intention. Usually people won't have to change their code because of that. If we want to document still, we should have a seprate bugfixes category. |
anntzer commentedNov 26, 2019
Actually, taking a step back... isn't this going to break people who are e.g. calling |
timhoffm commentedNov 26, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes. So to be defensive we want:
|
anntzer commentedNov 26, 2019
Actually, now that I think of it again, it seems a bit gratuitious to forbid |
timhoffm commentedNov 27, 2019
I feel a bit different about My interpretation of a pure Side remark: |
anntzer commentedNov 27, 2019
I agree norm=(vmin, vmax) would have been nice but that ship has sailed. I guess I'm -0 on deprecating |
d2c7af2 toeb42e75Comparetimhoffm commentedNov 28, 2019
I've decided to move forward with deprecating simultaneous use ofnorm andvmin/vmax. Let's see what others say. |
64685ac toc29df1bCompareanntzer commentedNov 29, 2019
Actually looking at this again (^2), if we want to go in this direction, perhaps (in a separate PR) we can indeed add support for norm=(vmin, vmax) and "soft-deprecate" vmin=..., vmax=...? (hide it behind kwargs, don't mention them in the main docs but only as an aside to the docs of norm?) |
timhoffm commentedDec 1, 2019
I would support that direction, but that's definitively something for another PR. Also the name For this PR, let's just make the existing API behave consistently and match the documentation. |
c29df1b to031a0dcComparejklymak commentedDec 13, 2019
Given that, I'm somewhat skeptical about disallowing |
efiring left a comment
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.
Deprecations are annoying, but so is an overly complicated API. I think that this cleanup is in the best long-term interest of mpl.
031a0dc tof5d9116CompareUh oh!
There was an error while loading.Please reload this page.
anntzer left a comment
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.
Approving (modulo one minor nit that can be ignored), but I'll leave a few more days for others to comment (if any) because I'm only 95% sure it's a good idea :)
f5d9116 to5a1a654Compare5a1a654 to0a2f082Compare
anntzer left a comment
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.
can selfmerge postci
tacaswell commentedJan 2, 2020
This is a case were we are going to have to be sensitive to any protest from users. Agree with@jklymak that deprecating |
timhoffm commentedJan 2, 2020
Let's see if this deprecation causes user feedback. I'm not sure either if we finally want to deprecate |
anntzer commentedJan 2, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
FWIW |
tacaswell commentedJan 3, 2020
@anntzer sure, but that is a bit annoying. This is one of those application vs library balance discussions (and I'm leaning towards the application side). |
anntzer commentedOct 23, 2020
Actually, one thing I had missed is that there's also already |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
Fixes#14603.
The brings the behavior in line with thescatterdocumentation:Also, when anorm is given, we shouldn't autoscale.Update: After discussion, the new behavior in this PR is#15769 (comment). Docs are updated accordingly.