I am new to python and stackoverflow and I will move on to examples in matplotlib. I was looking for a solution to this problem with no luck, although I managed to find a previously unanswered question in stackoverflow with the same problem.
Basically, I copied the code available from the examples into matplotlib ; eg:
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def data_gen(t=0): cnt = 0 while cnt < 1000: cnt += 1 t += 0.1 yield t, np.sin(2*np.pi*t) * np.exp(-t/10.) def init(): ax.set_ylim(-1.1, 1.1) ax.set_xlim(0, 10) del xdata[:] del ydata[:] line.set_data(xdata, ydata) return line, fig, ax = plt.subplots() line, = ax.plot([], [], lw=2) ax.grid() xdata, ydata = [], [] def run(data):
I run various animation examples in Anaconda 2 (python 2.7) and 3 (python 3.5), and both give me an empty plot without animation. However, each animation works great in Enthought Canopy.
Is there something simple that I don't see when using spyder?
python matplotlib animation
Medalgardr
source share