{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10072","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10072/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10072/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10072/events","html_url":"https://github.com/matplotlib/matplotlib/issues/10072","id":283944054,"number":10072,"title":"imshow doesn't properly display some images","user":{"login":"jbhopkins","id":23534688,"avatar_url":"https://avatars3.githubusercontent.com/u/23534688?v=4","gravatar_id":"","url":"https://api.github.com/users/jbhopkins","html_url":"https://github.com/jbhopkins","followers_url":"https://api.github.com/users/jbhopkins/followers","following_url":"https://api.github.com/users/jbhopkins/following{/other_user}","gists_url":"https://api.github.com/users/jbhopkins/gists{/gist_id}","starred_url":"https://api.github.com/users/jbhopkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbhopkins/subscriptions","organizations_url":"https://api.github.com/users/jbhopkins/orgs","repos_url":"https://api.github.com/users/jbhopkins/repos","events_url":"https://api.github.com/users/jbhopkins/events{/privacy}","received_events_url":"https://api.github.com/users/jbhopkins/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/30","html_url":"https://github.com/matplotlib/matplotlib/milestone/30","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/30/labels","id":2980459,"number":30,"title":"v2.1.2","description":"on-merge: backport to v2.1.x","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars3.githubusercontent.com/u/199813?v=4","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":54,"state":"closed","created_at":"2017-12-14T18:33:35Z","updated_at":"2018-01-18T20:25:08Z","due_on":null,"closed_at":"2018-01-18T20:25:08Z"},"comments":17,"created_at":"2017-12-21T16:59:34Z","updated_at":"2018-04-13T14:00:52Z","closed_at":"2018-01-15T20:36:07Z","author_association":"CONTRIBUTOR","body":"### Bug report\r\n\r\n**Bug summary**\r\nWhen using imshow with larger images, you lose pixel resolution for low intensity pixels with lots of nearby zeros (not sure if the intensity or nearby zeros are relevant, or just relative isolation of the pixel). It's like they're being interpolated away, even if interpolation is set to nearest. This is new behavior in version 2.1.\r\n\r\n**Code for reproduction**\r\nUse the attached npy file, which is an image referenced in this test script.\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nimg = np.load('test_image.npy')\r\n\r\n#Display full image\r\nplt.imshow(img, interpolation = 'nearest')\r\nplt.clim(0, 5)\r\nplt.show()\r\n\r\n#Display part of image\r\nplt.imshow(img[200:400,500:700], interpolation = 'nearest')\r\nplt.clim(0, 5)\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\nUsing matplotlib 2.1.1:\r\nScreenshot from the display of full image (first plot in code above):\r\n![full_plot_2p1](https://user-images.githubusercontent.com/23534688/34265221-4dc67306-e643-11e7-80ee-ab4886a03f65.png)\r\n\r\nUsing the  zoom tool to zoom in on a region when the full image is plotted:\r\n![zoom_full_plot_2p1](https://user-images.githubusercontent.com/23534688/34265229-53ac1550-e643-11e7-81d3-6519f2975046.png)\r\n\r\nPlotting roughly the same zoom region initially (second plot in code above):\r\n![partial_plot_2p1](https://user-images.githubusercontent.com/23534688/34265239-5c248a3c-e643-11e7-893f-a2cd6445a34b.png)\r\n\r\n\r\n**Expected outcome**\r\nIt should all look like the third image. Here's the output when the same code is run in version 2.0.2\r\nScreenshot from the display of full image (first plot in code above):\r\n![full_plot_2p0](https://user-images.githubusercontent.com/23534688/34265349-9a67f072-e643-11e7-80a7-ed77c4f9d5cf.png)\r\n\r\nUsing the  zoom tool to zoom in on a region when the full image is plotted:\r\n![zoom_full_plot_2p0](https://user-images.githubusercontent.com/23534688/34265367-a3143028-e643-11e7-82b9-da96e16c6284.png)\r\n\r\nPlotting roughly the same zoom region initially (second plot in code above):\r\n![partial_plot_2p0](https://user-images.githubusercontent.com/23534688/34265376-a9e27dec-e643-11e7-9bf2-c1e36fe90a9d.png)\r\n\r\n\r\n**Matplotlib version**\r\n  * Operating system: macOS 10.12.6\r\n  * Matplotlib version: 2.1.1 (broken) and 2.0.2 (working)\r\n  * Matplotlib backend (`print(matplotlib.get_backend())`): MacOSX\r\n  * Python version: 2.7.12\r\n  * Other libraries: numpy version 1.13.3\r\n\r\nAll libraries are installed through conda, using the standard channel. This includes both versions of matplotlib (2.1.1 and 2.0.2).\r\n\r\nNumpy file with image data:\r\n[test_image.zip](https://github.com/matplotlib/matplotlib/files/1579886/test_image.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/381144731","html_url":"https://github.com/matplotlib/matplotlib/issues/10072#issuecomment-381144731","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10072","id":381144731,"user":{"login":"jklymak","id":1562854,"avatar_url":"https://avatars0.githubusercontent.com/u/1562854?v=4","gravatar_id":"","url":"https://api.github.com/users/jklymak","html_url":"https://github.com/jklymak","followers_url":"https://api.github.com/users/jklymak/followers","following_url":"https://api.github.com/users/jklymak/following{/other_user}","gists_url":"https://api.github.com/users/jklymak/gists{/gist_id}","starred_url":"https://api.github.com/users/jklymak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklymak/subscriptions","organizations_url":"https://api.github.com/users/jklymak/orgs","repos_url":"https://api.github.com/users/jklymak/repos","events_url":"https://api.github.com/users/jklymak/events{/privacy}","received_events_url":"https://api.github.com/users/jklymak/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T14:00:52Z","updated_at":"2018-04-13T14:00:52Z","author_association":"CONTRIBUTOR","body":"The scaling is there to make sure out-of-range interpolation works properly.  \r\n\r\nWe need to do math on your data to plot it.  If you supply values that cause floating point roundoff you will get floating point roundoff and your data will lose resolution. "}}
{"actor":{"display_login":"jklymak"}}