Matplotlib Style Gallery

This post is more than a year in the making (life got in the way), so this isn't exactly hot off the press. I added support for style-sheets back in Matplotlib 1.4, based on my implementation in mpltools [1], and built a gallery page to easily compare styles ...

IPython (Jupyter) widgets: An image convolution demo

Convolution is one of the fundamental concepts of image processing (and more generally, signal processing). For the scikit-image tutorial at Scipy 2014, I created an IPython widget to help visualize convolution. This post explains that widget in more detail.

Only a small portion of this post is actually about using ...

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 ...

Plotting streamlines with Matplotlib and SymPy

Fluid mechanics lends itself to some beautiful visualizations and images. I won't cover anything too complicated here, just potential flow, which any undergrad who has taken a fluid mechanics course should be (at least somewhat) familiar with.

I won't really cover the math or theory here; I'm ...

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 ...```