-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Change in ListedColormap behavior in 3.10.0 #29504
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
Comments
This is likely due to #28061 which moved the default interpolation stage from data space to rgba space when we are aggressively down sampling. There is an API change note in that PR that I can not find it in the rendered docs (I need to look into that), but setting the |
also, thank you for the very detailed bug report 🎉 ! |
Wow! Thank you for such a fast response - I'm going to set |
That's definitely improving our outputs! @jsolbrig will likely chime in soon with more detail on the specifics. |
Thank you! As I suspected, this fixes part of our problem. The differences shown in the striped images above disappear and the image-diff from our integration tests improves. Most of our integration tests are completely fixed, but this one still has some lingering issues but I think I'll submit a different issue when I track it down. For reference, the image-diff prior to changing this setting is shown in the first image below where red indicates some amount of change. The second image shows the image diff after changing this setting. I have a suspicion that the remaining issues have something to do with The last two images show a diff that uses a threshold to look for more substantial changes. The first is without the new setting and the second is with the new setting. |
Bug summary
While running integration tests on a package that I maintain I'm seeing a change in the behavior of
ListedColormap
in 3.10.0. This appears to be a regression and is causing significant changes in some of the imagery that my tests produce.The tests are baked into a larger system and would be difficult for matplotlib maintainers to replicate, so I wrote up a dummy script that, I think, shows the problem. I'm not sure if it is capturing the full problem or not but it's at least capturing part of it.
Code for reproduction
Actual outcome
With v3.10.0 I get the following images. If you zoom in on the borders between color bands, you will see some lines of different color.
Zoomed in:
Expected outcome
With v3.9.4 I get the following output. If you zoom in on the borders between the color bands, there is a sharp transition between bands with no extra colors.
Zoomed in:
Additional information
Just for additional context, below are the really ugly images produced by our integration tests. The changes in how the colormaps are applied appear to be the cause of some of the differences here, though I don't think they actually address everything.
3.10.0
3.9.4
Operating system
Rocky
Matplotlib Version
3.10.0
Matplotlib Backend
agg
Python version
3.10.16
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: