Skip to content

imshow interpolation uses masked values #8012

Closed
@dshean

Description

@dshean

Bug report

I recently upgraded to v2.0.0 and noticed that the new imshow interpolation is not honoring masked values. This is likely related to the new edge handling, described here: http://matplotlib.org/examples/pylab_examples/image_interp.html

Code for reproduction

a = np.random.random((7,7))*1000
ndv = -9999.0
a[2:4,1:5] = ndv
am = np.ma.masked_equal(a, ndv)

plt.figure()
#Plot with no interpolation, looks fine
plt.imshow(am, interpolation='none')
plt.title("interpolation='none'")
#Plot with bilinear interpolation, the -9999.0 values are used 
plt.imshow(am, interpolation='bilinear')
plt.title("interpolation='bilinear'")

Actual outcome

none

bilinear

Expected outcome

The interpolation should ignore masked values as in previous versions.

Matplotlib version

  • Matplotlib v2.0.0, Python 2.7.13, OSX
  • installed from pip

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions