{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5900","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5900/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5900/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5900/events","html_url":"https://github.com/matplotlib/matplotlib/issues/5900","id":128288617,"number":5900,"title":"Incorrect Image Tutorial Inline Sample Code","user":{"login":"katzenbaer","id":1815591,"avatar_url":"https://avatars.githubusercontent.com/u/1815591?v=3","gravatar_id":"","url":"https://api.github.com/users/katzenbaer","html_url":"https://github.com/katzenbaer","followers_url":"https://api.github.com/users/katzenbaer/followers","following_url":"https://api.github.com/users/katzenbaer/following{/other_user}","gists_url":"https://api.github.com/users/katzenbaer/gists{/gist_id}","starred_url":"https://api.github.com/users/katzenbaer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzenbaer/subscriptions","organizations_url":"https://api.github.com/users/katzenbaer/orgs","repos_url":"https://api.github.com/users/katzenbaer/repos","events_url":"https://api.github.com/users/katzenbaer/events{/privacy}","received_events_url":"https://api.github.com/users/katzenbaer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-23T03:01:09Z","updated_at":"2016-01-23T19:06:09Z","closed_at":"2016-01-23T19:05:39Z","body":"The inline/inpage sample code under the [Array Interpolation schemes](http://matplotlib.org/users/image_tutorial.html#array-interpolation-schemes) heading is incorrect. However, the Source Code linked below the inline code is correct. \r\n\r\nFor example, see `In[20]`:\r\n```\r\nIn [20]: imgplot = plt.imshow(resized, interpolation=\"nearest\")\r\n```\r\nwhich links to [image_tutorial-9.py](http://matplotlib.org/users/image_tutorial-9.py).\r\n\r\nThis sample code assumes the users has followed the previous inline sample code:\r\n```\r\nIn [16]: from PIL import Image\r\nIn [17]: img = Image.open('../_static/stinkbug.png')\r\nIn [18]: resized = img.thumbnail((64, 64), Image.ANTIALIAS) # resizes image in-place\r\nIn [19]: imgplot = plt.imshow(img)\r\n```\r\n\r\nAs shown on `In [18]`, the thumbnail function resizes the image **in-place**. This means that `resized` is an empty variable and cannot be passed into `plt.imshow()`. The inline sample code should instead follow the downloadable sample code and pass `img` into `plt.imshow()`.\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/174212901","html_url":"https://github.com/matplotlib/matplotlib/issues/5900#issuecomment-174212901","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5900","id":174212901,"user":{"login":"katzenbaer","id":1815591,"avatar_url":"https://avatars.githubusercontent.com/u/1815591?v=3","gravatar_id":"","url":"https://api.github.com/users/katzenbaer","html_url":"https://github.com/katzenbaer","followers_url":"https://api.github.com/users/katzenbaer/followers","following_url":"https://api.github.com/users/katzenbaer/following{/other_user}","gists_url":"https://api.github.com/users/katzenbaer/gists{/gist_id}","starred_url":"https://api.github.com/users/katzenbaer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzenbaer/subscriptions","organizations_url":"https://api.github.com/users/katzenbaer/orgs","repos_url":"https://api.github.com/users/katzenbaer/repos","events_url":"https://api.github.com/users/katzenbaer/events{/privacy}","received_events_url":"https://api.github.com/users/katzenbaer/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T19:06:09Z","updated_at":"2016-01-23T19:06:09Z","body":"A fixed has been merged."}}