-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Accessing default norm
of a Collection removes its colors.
#13887
Comments
norm
of a LineCollection
removes its colors.norm
of a Collection removes its colors.
This happens because the norm bounds (min/max) are only computed at draw time, but when you call One could change it to have the min/max be computed when the LineCollection is instantiated instead, but I'm sure someone out there relies on being able to change the Collection's mapped values after instantiation but before drawing and then expects the min/max to pick it up. Having thought approximately 15s about it, I do think that normalizing at artist instantiation (specifically, in set_norm) does look better than at first draw, though (and the above-mentioned disgruntled users can always call set_norm() with a new Normalize instance after updating the mapped values -- which will work even after the first draw. Remilestoning as 3.2 as I think it's a change in "intended" behavior (the degree of intent is unclear in this case, though :-)). |
I understand that any fix to this might be an API change. My expectation simply comes from the fact that
or
work as expected. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
I didn't check if this was still an issue but if so seems worth fixing. |
Can confirm that the behavior still exists. |
This gave me some headaches to even isolate. Very weird bug!
Bug report
Bug summary
Accessing the default
norm
of aCollection
removes its colors.Code for reproduction
Create a
LineCollection
and access itsnorm
.Actual outcome
Same bug is present if you replace
LineCollection
byPolyCollection
. Possibly other collections are equally affected.Expected outcome
Expected outcome is the same as when removing the
print
statement.Fun Fact:
If adding a colorbar first, the whole thing runs fine.
Matplotlib version
print(matplotlib.get_backend())
): TkAgg (1.5.3), Qt5Agg (master)The text was updated successfully, but these errors were encountered: