Plot inline or a separate window using Matplotlib in Spyder IDE

Magic commands such as %matplotlib qt work in the iPython console and Notebook, but do not work within a script. In that case, after importing: from IPython import get_ipython use: get_ipython().run_line_magic(‘matplotlib’, ‘inline’) for inline plotting of the following code, and . get_ipython().run_line_magic(‘matplotlib’, ‘qt’)

Read More