I am using Matplotlib 2.0.2 in a Python 3.6 script on Windows 10 to plot data received over a network connection. New data arrives 4 times per second. I need to update two figures, each containing 8 subplots. I do this using animation:
anim = []
anim.append( matplotlib.animation.FuncAnimation(fig_A, updatePlots_A, frames=None, interval=100, repeat=True) )
anim.append( matplotlib.animation.FuncAnimation(fig_B, updatePlots_B, frames=None, interval=100, repeat=True) )
plt.show()
My question is whether it is ok to make two FuncAnimation calls in this way? Is that the most efficient way of handling the plots?
The figures are not very responsive to user input. Moving a figure by dragging it with the mouse is very sluggish.
I've chosen:
frames=None, interval=100
because I want each of my update functions to be called at 10Hz. Will the code achieve this (machine performance permitting)?
I tried using matplotlib.pyplot.pause() instead of FuncAnimation() but found the update rate was then worse, so went back to using FuncAnimation().
Any comments for improvement would be appreciated.