I'm attempting to animate (at run time) unlike this answer in mac os and ipython notebook 2.0. I have the following code:
%pylab inline
import time, sys
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import clear_output
f, ax = plt.subplots()
x = np.linspace(0,6,200)
for i in range(10):
y = i/10*np.sin(x)
print i
ax.plot(x,y)
time.sleep(0.1)
clear_output(True)
display(f)
ax.cla() # turn this off if you'd like to "build up" plots
plt.close()
Which seems to almost work, as the print
is working without flashing (a previous problem, corrected by clear_output
), but the axes are not updating.