-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
UserWarning thrown when all values are "bad", but not when only some are #18294
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
The warning comes from NumPy, so not sure there is much Matplotlib can do? I'll close this, but feel free to reopen if you have another opinion (and sorry for letting this go unnoticed for so long). |
@oscargus, could matplotlib just catch the warning at plot time? I figure if the behavior is intentional from matplotlib, it would be nice if it didn't warn. |
Ahh, I should have checked what happens in latest Matplotlib. Now it actually breaks:
Pinging @tacaswell who seems to have worked on Regarding if it is intentional or not can be discussed. We don't raise the warning and if we catch it, it may lead to confusion. At least in the general case. |
Bug report
Bug summary
If all values passed as colors are "bad" (
np.nan
), a warning is thrown from numpy about converting masked values to null. If some of the values are "bad", this does not happen.Code for reproduction
This does not warn:
This does:
This is difficult to hide since since the warning is not thrown when the figure is being constructed, but when it is shown. Here's a full traceback to show this:
Full traceback
Expected outcome
I wouldn't expect the second to warn if the first doesn't.
Matplotlib version
print(matplotlib.get_backend())
): MacOSX and module://ipykernel.pylab.backend_inlineInstalled with pip
The text was updated successfully, but these errors were encountered: