Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Spyder, plot using Matplotlib with interactive zoom, etc

Tags:

I've recently switched from Enthought Canopy to Anaconda and am using the Spyder IDE. I've noticed that when I plot some data,

import matplotlib.pyplot as plt plt.figure() plt.plot(rigs2) plt.ion() plt.show() 

It shows up as an inline figure in the IPython console:

Result from the plt.plot() command

However, in Enthought it used to be that the plot would show up in a separate window with zoom, back, and forward buttons. Is there any way to achieve the same in Spyder?

like image 977
Kurt Peek Avatar asked Apr 18 '16 17:04

Kurt Peek


1 Answers

Select from the menu Tools > Preferences, then IPython console in the list of categories on the left, then the tab Graphics at the top, and change the Graphics backend from Inline to e.g. Qt.
For me though, the figures then always pop up in the background.
(I use Spyder 3.0.0dev bundled with WinPython 3.4.)

like image 156
Norman Avatar answered Oct 20 '22 08:10

Norman