I have a simple python script as
import numpy as np
import matplotlib.pyplot as plt
import pylab
x = np.arange(0, 5, 0.1)
y = np.sin(x)
plt.plot(x, y)
pylab.show()
If I run it from the terminal, it opens the interactive window of pylab
to show the output graph. But if I run the script by Spyder
, only a static image is shown in the console.
How can I tell Spyder
to open the interactive graph of pylab
? Or how should I modify my code to diplay an interactive graph (with the ability to zoom and enlarge).