I need to generate an animation in an application that I am building in streamlit.
At first, I generated the animation as follows:
ani = FuncAnimation(fig, animate, frames=range(0,len(x),skipframes), interval=30, blit = True, repeat = False)
HTML(ani.to_jshtml())
components.html(ani.to_jshtml(),height=800)
However, the plot takes a long time to appear (about 20 seconds), perhaps because it is in a heavier format than a simple gif. Locally in pycharm the plot is faster (about 5 seconds) and I used the following command
ani = FuncAnimation(fig, animate, frames=range(0,len(x),skipframes), interval=30, blit = True, repeat = False)
plt.show()
But when I use it on streamlit the plot just doesn’t appear. The code runs, but no graphics, animations or errors appear.
To plot in gif format on streamlit do I need to make some kind of change? Or is there any way to generate the animation in a lighter way than the HTML
videos on this site?