Animated plots using Matplotlib (Python) [SINE WAVE ANIMATION]

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation

# References

def func(t, line):
    t = np.arange(0,t,0.1)
    y = np.sin(t)
    line.set_data(t, y)
    return line

fig = plt.figure()
ax = plt.axes(xlim=(0, 100), ylim=(-1.2, 1.22))
redDots = plt.plot([], [], 'ro')
line = plt.plot([], [], lw=2)

# Creating the Animation object
line_ani = animation.FuncAnimation(fig, func, frames=np.arange(1,100,0.1), fargs=(line), interval=100, blit=False)'Animation.mp4')


MP4 Video


[wpedon id="7041" align="center"]

One thought on “Animated plots using Matplotlib (Python) [SINE WAVE ANIMATION]

Leave a Reply

Your email address will not be published. Required fields are marked *