I have a python program that plots the data from a file as a contour plot for each line in that text file. Currently, I have 3 separate contour plots in my interface. It does not matter if I read the data from a file or I load it to the memory before executing the script I can only get ~6fps from the contour plots.
I also tried using just one contour and the rest normal plots but the speed only increased to 7fps. I don't believe that it is so computationally taxing to draw few lines. Is there a way to make it substantially faster? Ideally, it would be nice to get at least 30fps.
The way I draw the contour is that for each line of my data I remove the previous one:
for coll in my_contour[0].collections:
coll.remove()
and add a new one
my_contour[0] = ax[0].contour(x, y, my_func, [0])
At the beginning of the code, I have plt.ion() to update the plots as I add them.
Any help would be appreciated.
Thanks

contourneeds to recompute the data on every iteration, so there is little gain expected. Drawing time could potentially be reduced by using blitting, but I doubt that this will bring you from 7 to 30 fps. - ImportanceOfBeingErnestax[0].draw_artist(my_contour[0])on my contour plot. It gives me an error. If I do everything else as stated there except instead ofax[0].draw_artist(my_contour[0])I usefig.canvas.draw()I get an increase of 2fps. How should I handle blitting properly with contour plot? - UN4