Animating particles in a flow

This article demonstrates matplotlib's animation module by animating marker particles in a fluid flow around a cylinder. It's a bit long because it ties together a number of different ideas:

  • stream functions
  • numerical integration
  • plotting and animation

Before we really start, let's copy a function from a ...

more ...


Plotting error bars

Let's say you have some continuous data with a continuous error (or variance) measurement. Typically, you would just call matplotlib's errorbar function:

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 2 * np.pi)
y_sin = np.sin(x)
y_cos = np.cos(x)
plt.errorbar ...
more ...