i try to make a dynamical plot in a method of a class. here is more or less the method
def plot():
axes = plt.gca(bock=False)
ydata = []
xdata = []
axes.set_xlim(0, 200)
axes.set_ylim(-1,1)
line, = axes.plot(ydata, 'r-')
i=0
while True:
xdata.append(i/10)
ydata.append(np.sin(i/10))
line.set_ydata(ydata)
line.set_xdata(xdata)
plt.draw()
plt.pause(1e-17)
i+=1
plt.show()
The problem is the fact that it's an infinity loop and during this loop function, i can do nothing. i can't use my Ipython console. I would like make run this method without block the console. i arrived to do something like that using just print and threading but matplotlib dont support threading. I tried using multiprocessing but that still block the console. any options?