-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BUG: matplotlib 3.4.0 -- Scatter with colormap and legend gives TypeError: object of type 'NoneType' has no len() #19779
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
A bisect diagnose shows that the problem was introduced in the commit A quick fix is easy, but I don't have much in-depth understanding of this part of the code. If anyone familiar with this part can have a discussion, that would be great. Or I just open a PR for discussion. |
Opening a PR is probably the best way forward 👍 |
Actually, this problem has been solved in the commit ed6d92b (#19552), but this commit was not included in v3.4.x branch. Backport that commit will solve this problem. |
That commit removes API and cannot be included in v3.4.x directly. |
Maybe we should just drop the |
This is a slight backport of ed6d92b, namely ignoring the array update status when updating the scalar mappable. To not break the watchers though, the check must still be called to update the status. Fixes matplotlib#19779.
These were added in matplotlib#18480, and not copying them can mean that an artist that used `update_from` could get in an inconsistent state. For example, this will fix legends of colour-mapped scatter plots, where a copy of the scatter Collection is made to go in the legend. Fixes matplotlib#19779.
Closed by #19816. |
Thanks for the quick fix! |
Bug report
Bug summary
With
matplotlib
3.4.0, scatter plot with colormap and legend givesTypeError: object of type 'NoneType' has no len()
.Code for reproduction
Actual outcome
Expected outcome
With matplotlib 3.3.4, I get this (no warning or error):
Matplotlib version
import matplotlib; print(matplotlib.__version__)
): 3.4.0print(matplotlib.get_backend())
): Qt5AggThe text was updated successfully, but these errors were encountered: