-
-
Notifications
You must be signed in to change notification settings - Fork 358
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 get_cmap MatplotlibDeprecationWarning #633
Conversation
Thank you. Does this put a new upper limit on the used matplotlib version? |
Matplotlib 3.7 was just released, but it looks like this was actually deprecated since 3.6. |
Sorry, I meant: lower limit. In the sense of: this will probably not work on (very) old versions of matplotlib. |
@sharkdp Yes, looks like the new method bumps the minimum version to 3.5:
|
Correct. I found that out last week but didn’t have time to update this PR. I think this can stay as-is at least until |
@nicovank Literally, why not both? The simplest imho is to dynamically choose either of them and call the existing variant (as long the underlying API is the same? I didn't check). That's gonna be the fastest solution? If you want to recreate the rainbow colors it's as simple as iterating over the HSL color space: different degree 0-360° on the spectrum with maximum saturation and luminance. If you want to exercise in the above, there's the human-friendlier version https://www.hsluv.org/ :) The HSL iteration is a couple of lines of code in any language, HSLuv is going to be a required dependency for a minimal effect. |
As per matplotlib/matplotlib#20853:
So I think it's best here to just use that (versus AFAIK this does not set a new lower bound to the used Matplotlib. I tested on my machine down to 2.0.0 (released January 2017). Beyond this, it fails for some unrelated ( |
Okay. So the following statement was incorrect?
|
It was accurate with the previous change (see commit history). |
Oh, sorry. I missed the new commit. Thank you! |
After this change, the warning disappears, and the output plot looks unchanged.