Animation in Matplotlib?
In this tiny piece of post I'm gonna post how you can make animations using the
matplotlib module in Python. Things get much more intuitive when they move, don't they?
We're here trying to plot two (thick) sine curves which have different offsets on the x-axis direction, and those offsets increases with an indicator called
import numpy as np
The plot is altered bit by bit as
frame_no changes with frames. You can also try different fps configurations by changing the
interval argument. Also, repetition is set true by default, but you may still forbid it by specifying
repeat as false in
FuncAnimation. Finally, you would have a plot as follows:
Lovely, isn't it?