You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Interpolating with imshow makes some squares appear on plot #8964
I'm witnessing a behavior that seems like a bug when using imshow() with the interpolation flag. Consider this example:
from matplotlib import pyplot as plt
W=np.random.randn(200,200)
plt.imshow(W, interpolation='bicubic', cmap='seismic', vmin=-3, vmax=3)
This results in the following image:
Obviously I did not expect the squares to be there. This issue also happens with the option bilinear, gaussian, bessel and pretty much every other interpolation that I tested that isn't nearest.
Here's the output of the nearest option, just for comparison:
So this is weird in that the squares are larger than a "data pixel". I don't know what's causing this. The squares apparently pop where the value is larger/smaller than vmax/vmin, but that's about all I know.
Some notes:
If I don't set vmin and vmax this effect doesn't happen.
I'm using version 2.0.2 of matplotlib
This issue happens in Python 3.4 and 3.5 and Python 2.7 with said version of matplotlib
Doesn't appear to affect Python 2.7 and matplotlib 2.0.0
Activity
tacaswell commentedon Jul 30, 2017
This is a duplicate of #8631
Those squares are the size of the kernel used for the interpolation and are the 'poisoned' region around a point over/under the max/min.
tomchor commentedon Jul 30, 2017
I see. I imagined this bug had been reported but since I couldn't find i in the issues list t I submitted my own. Thanks.
tacaswell commentedon Jul 30, 2017
Going to close this just to keep the issues tidy, please chime in on #8631 if you want to add anything else!