8000 spurious warning with nans in log-scale plot · Issue #7143 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

spurious warning with nans in log-scale plot #7143

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

Closed
anntzer opened this issue Sep 20, 2016 · 2 comments
Closed

spurious warning with nans in log-scale plot #7143

anntzer opened this issue Sep 20, 2016 · 2 comments
Milestone

Comments

@anntzer
Copy link
Contributor
anntzer commented Sep 20, 2016

mpl1.5.3 and mpl2.0b4

semilogy([1, 2, 3], [1, np.nan, 2], "o")

triggers a warning:

/usr/lib/python3.5/site-packages/matplotlib/scale.py:93: RuntimeWarning: invalid value encountered in less_equal
  mask = a <= 0.0

due to the comparison that involves a nan. I think this warning should be masked out (likely with the application of a np.errstate at the right place), given that nans are (AFAIK) a fully supported mechanism for hiding a point in a plot, and e.g. do not raise any warning in linear scale.

@efiring
Copy link
Member
efiring commented Sep 20, 2016

I agree. The function below that one will need the same treatment. Also _clip_non_logit and _mask_non_logit farther down. It's not clear why these pairs of nearly-identical functions are implemented differently. Direct indexing appears to be faster than using where.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Sep 20, 2016
@tacaswell
Copy link
Member

Probably related to #7129

Are these warnings new in numpy 1.11?

@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.0.1 (next bug fix release) Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0