Need help with Blitting

Hey all! First time posting here. I am trying to animate some Turing patterns and my code seems to be running rather slow. In the code I make sure to set blit=True and flag the heat map as animated, but the blitted code runs just as slow as the non-blitted code.

Code (working):

Have you timed it to see if the plotting code is the slow part? Maybe the calculations are slow.

1 Like

Odds are quite high you can avoid the double for-loops. Those tend to be slow.

1 Like

Hey, I ended up vectorizing the computation and that basically fixed it. I think it is as fast as I’m gonna get it in Python now. It’s usable for the most part.

I used the convolve method with the kernel in that helper function.