python - Pylab animation multiple figures -
i want update multiple figures using pylab animation. initialize new figure each channel display , set interactive mode off using:
pyplot.ion() pyplot.show()
in class containing figure there's ring buffer , method update data:
def append_data(self, data): update buffers data ... ... self.lineb.set_data(self.tbuf, self.bbuf) self.ax1.set_xlim( [min(self.tbuf), max(self.tbuf)] ) self.ax1.set_ylim( [min(self.bbuf), max(self.bbuf)] ) ... ... self.fig.show() pyplot.draw()
the problem: more 1 figure, last 1 updates correctly. other ones not refresh. know data correctly added each figure's buffer, problem not there.
i found solution following this article.
i initialized figure name:
fig = pyplot.figure(name)
and changed lines:
self.fig.show() pyplot.draw()
to:
pyplot.figure(name) pyplot.draw()
apparently works, not sure why.
Comments
Post a Comment