Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show plots in new window instead of inline (not answered by previous posts)

Several existing posts address this question, but none of the solutions worked for me.

I am using Spyder 3.2.4 with Python 3.6. I'd like plots to show up in a new window instead of as tiny in-line figures in the IPython console.

I tried Tools > Preferences > IPython console > Graphics > Graphics backend > Automatic. I also tried Qt5 and Qt4 here, and closed and reopened the file I was trying to run (see code below).

I also tried

 matplotlib qt 

directly in the console, with no result.

I checked whether the windows might be popping up in the background, but they are not.

Any ideas?

Code:

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(10)
y = x**2

plt.ion()   
plt.plot(x,y)
plt.show()
like image 739
Takver Avatar asked Nov 20 '17 19:11

Takver


1 Answers

Go to Tools > preferences > IPython console > Graphics > Graphics backend > Backend: Automatic After this don't forget to restart the kernel, you can do that by clicking on setting button on the top right corner of the console.If this still doesn't work for you, try typing %matplotlib auto in the console.

like image 139
Shubham Chopra Avatar answered Nov 18 '22 11:11

Shubham Chopra