![]() ![]() Pieces of numpy and matplotlib, The script sets up the plot:Īnim = animation. Let's step through this and see what's going on. save ( 'basic_animation.mp4', fps = 30, extra_args = ) plt. You may need to adjust this for # your system: for more information, see # anim. The extra_args ensure that the x264 codec is used, so that # the video can be embedded in html5. This requires ffmpeg or mencoder to be # installed. FuncAnimation ( fig, animate, init_func = init, frames = 200, interval = 20, blit = True ) # save the animation as an mp4. blit=True means only re-draw the parts that have changed. ![]() set_data ( x, y ) return line, # call the animator. This is called sequentially def animate ( i ): x = np. set_data (, ) return line, # animation function. plot (,, lw = 2 ) # initialization function: plot the background of each frame def init (): line. Thanks! """ import numpy as np from matplotlib import pyplot as plt from matplotlib import animation # First set up the figure, the axis, and the plot element we want to animate fig = plt. ![]() """ Matplotlib Animation Example author: Jake Vanderplas email: website: license: BSD Please feel free to use and modify this, but keep the above information. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |