Tutorial by Examples

The matplotlib.animation package offer some classes for creating animations. FuncAnimation creates animations by repeatedly calling a function. Here we use a function animate() that changes the coordinates of a point on the graph of a sine function. import numpy as np import matplotlib.pyplot as p...
In this example we use the save method to save an Animation object using ImageMagick. import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import rcParams # make sure the full paths for ImageMagick and ffmpeg are configured rcParams['ani...
For interacting with plots Matplotlib offers GUI neutral widgets. Widgets require a matplotlib.axes.Axes object. Here's a slider widget demo that ùpdates the amplitude of a sine curve. The update function is triggered by the slider's on_changed() event. import numpy as np import matplotlib.pyplot...
This can be usefull when you want to visualize incoming data in real-time. This data could, for example, come from a microcontroller that is continuously sampling an analog signal. In this example we will get our data from a named pipe (also known as a fifo). For this example, the data in the pipe ...

Page 1 of 1