I am trying to animate a video of a figure of two subplots, but I was not able to do it.
I have two lists of lists of the same size, which I want to use to create figures of two subplots by iterating through the lists.
This is my figure:
fig = plt.figure()
ax1 = fig.add_subplot(2, 1, 1)
ax2 = fig.add_subplot(2, 1, 2)
Here are my subplots:
ax1.imshow(list_1[i].reshape(5, 20), interpolation=None)
ax2.imshow(list_2[i].reshape(5, 20), interpolation=None)
What I now need is a way of animating a video by looping through my lists and rendering a video.
I tried FuncAnimation and ArtistAnimation, but was not able to do it.
Is there a way of solving my task. And if so, what is the best approach to do it?
Thank you very much for your time.