1

Codeplot I wrote the code above and it is showing my plot in the Ipython console. However, I want to inspect the plot i.e. be able to zoom in/out and have coordinates displayed when moving my cursor.

I know I can do this with executing the file from the location where it is saved. But is there a way to immediately show the plot in a new window when running my file in spyder?

Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
LMATH
  • 45
  • 6
  • Possible duplicate of [How to switch backends in matplotlib / Python](http://stackoverflow.com/questions/3285193/how-to-switch-backends-in-matplotlib-python) – Mad Physicist Aug 03 '16 at 13:41
  • Possible duplicate of [In Spyder, plot using Matplotlib with interactive zoom, etc](http://stackoverflow.com/questions/36700083/in-spyder-plot-using-matplotlib-with-interactive-zoom-etc) – Ohad Eytan Aug 03 '16 at 13:42

1 Answers1

0

I see that you have pyplot already imported. Run the following in your console:

plt.switch_backend('qt4agg')

If this does not work because the name plt is not recognized, import it in the console:

from matplotlib import pyplot as plt
Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
  • 1
    The latter one does seem to create a new window, however it disappears immediately. Do you know how to solve that problem? - edit: I figured out how to let the plot window stay for a longer time using http://stackoverflow.com/questions/10713966/interactive-plotting-in-spyder-with-matplotlib/10724654#10724654 – LMATH Aug 04 '16 at 07:37