{"action":"created","issue":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/620","labels_url":"https://api.github.com/repos/spyder-ide/spyder/issues/620/labels{/name}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/620/comments","events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/620/events","html_url":"https://github.com/spyder-ide/spyder/issues/620","id":57868744,"number":620,"title":"Debugging: unable to see plots made with matplotlib","user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/11%E2%80%9320%20stars","name":"11–20 stars","color":"FFFFFF"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/Debugger","name":"Debugger","color":"FFFFFF"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/imported","name":"imported","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-02-17T00:34:20Z","updated_at":"2015-02-17T00:34:25Z","closed_at":null,"body":"_From [al.dan...@gmail.com](https://code.google.com/u/100487118575071222856/) on 2011-04-12T17:33:50Z_\n\nThis script, when run within spyder, works fine and produces a contour plot:\r\n\r\n \\#!/usr/bin/env python\r\n from   matplotlib.pyplot import imshow, show\r\n import numpy as np\r\n x  = np.random.rand(4,5)\r\n imshow(x)\r\n show()\r\n\r\nHowever, if I enter debug mode and put a breakpoint at the imshow(x) line then manually type the imshow(x) and show() commands at the (Pdb) prompt, no plot appears.  I only get a reference to the plot object:\r\n\r\n (Pdb) imshow(x)\r\n \\<matplotlib.image.AxesImage object at 0x183f5150>\r\n (Pdb) show()\r\n (Pdb) \r\n\r\nWould be a nice enhancement to be able to plot variables in debug mode.\r\n\r\nPython 2.7.1\r\nNumPy  1.5.1\r\nmatplotlib 1.0.1  (WXAgg backend)\r\nRHEL 4.8 x86_64\n\n_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=620_"},"comment":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/comments/74596841","html_url":"https://github.com/spyder-ide/spyder/issues/620#issuecomment-74596841","issue_url":"https://api.github.com/repos/spyder-ide/spyder/issues/620","id":74596841,"user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T00:34:25Z","updated_at":"2015-02-17T00:34:25Z","body":"_From [jed.lud...@gmail.com](https://code.google.com/u/114333776555678317161/) on 2013-05-16T15:11:32Z_\n\nAnd, after a bit more research, I found this answer: http://stackoverflow.com/questions/12822762/pylab-ion-in-python-2-matplotlib-1-1-1-and-updating-of-the-plot-while-the-pro/12826273#12826273 So, if the code in the original post is modified in this manner:\r\n\r\nfrom matplotlib.pyplot import imshow, pause\r\nimport numpy as np\r\nx = np.random.rand(4,5)\r\nimshow(x)\r\npause(1)\r\n\r\nyou can get the plot to update, interactively, inside of a Spyder interactive console  during debugging without blocking! So, use pause(1) instead of show(). The plot only becomes interactive for the pause duration, so if you want more time to zoom or pan in the data, use pause(10) or pause(20). Works in the IPython Qt Console, too."}}