Skip to content

imshow no longer correctly handles 'bad' (nan) values #6069

Closed
@tacaswell

Description

@tacaswell

To help us understand and resolve your issue please check that you have provided
the information below.

  • [ v2.x ] Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
  • [ source ] How did you install Matplotlib and Python (pip, anaconda, from source ...)
  • If possible please supply a Short, Self Contained, Correct, Example
    that demonstrates the issue i.e a small piece of code which reproduces the issue
    and can be run with out any other (or as few as possible) external dependencies.
plt.imshow(np.ones((5, 5)) * np.nan)
  • If this is an image generation bug attach a screenshot demonstrating the issue.
    so

Also got some user warnings

 /home/tcaswell/.virtualenvs/dd_35/lib/python3.5/site-packages/numpy/ma/core.py:4089: UserWarning: Warning: converting a masked element to nan.
  warnings.warn("Warning: converting a masked element to nan.")
/home/tcaswell/source/p/matplotlib/lib/matplotlib/colors.py:581: RuntimeWarning: invalid value encountered in less
  cbook._putmask(xa, xa < 0.0, -1)
/home/tcaswell/source/p/matplotlib/lib/matplotlib/cm.py:275: RuntimeWarning: invalid value encountered in less
  rgba[:, :, 3][x < 0.0] = 0
  • [ always ] If this is a regression (Used to work in an earlier version of Matplotlib), please
    note where it used to work.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions