Thanks to visit codestin.com
Credit goes to github.com

Skip to content

spurious warning with nans in log-scale plot #7143

Closed
@anntzer

Description

@anntzer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions