FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Interpolating with `imshow` makes some squares appear on plot · Issue #8964 · matplotlib/matplotlib · GitHub

Repository navigation

Interpolating with imshow makes some squares appear on plot #8964

Description

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

  1. tacaswell commented on Jul 30, 2017

    Member

    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.

  2. added this to the milestone on Jul 30, 2017
  3. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Jul 30, 2017
  4. tomchor commented on Jul 30, 2017

    Author

    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.

  5. tacaswell commented on Jul 30, 2017

    Member

    Going to close this just to keep the issues tidy, please chime in on #8631 if you want to add anything else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL