Plot types#

Overview of many common plotting commands provided by Matplotlib.

See the gallery for more examples and the tutorials page for longer examples.

Pairwise data#

Plots of pairwise \((x, y)\), tabular \((var\_0, \cdots, var\_n)\), and functional \(f(x)=y\) data.

Image

plot(x, y)

plot(x, y)
Image

scatter(x, y)

scatter(x, y)
Image

bar(x, height)

bar(x, height)
Image

stem(x, y)

stem(x, y)
Image

fill_between(x, y1, y2)

fill_between(x, y1, y2)
Image

stackplot(x, y)

stackplot(x, y)
Image

stairs(values)

stairs(values)

Statistical distributions#

Plots of the distribution of at least one variable in a dataset. Some of these methods also compute the distributions.

Image

hist(x)

hist(x)
Image

boxplot(X)

boxplot(X)
Image

errorbar(x, y, yerr, xerr)

errorbar(x, y, yerr, xerr)
Image

violinplot(D)

violinplot(D)
Image

eventplot(D)

eventplot(D)
Image

hist2d(x, y)

hist2d(x, y)
Image

hexbin(x, y, C)

hexbin(x, y, C)
Image

pie(x)

pie(x)
Image

ecdf(x)

ecdf(x)

Gridded data#

Plots of arrays and images \(Z_{i, j}\) and fields \(U_{i, j}, V_{i, j}\) on regular grids and corresponding coordinate grids \(X_{i,j}, Y_{i,j}\).

Image

imshow(Z)

imshow(Z)
Image

pcolormesh(X, Y, Z)

pcolormesh(X, Y, Z)
Image

contour(X, Y, Z)

contour(X, Y, Z)
Image

contourf(X, Y, Z)

contourf(X, Y, Z)
Image

barbs(X, Y, U, V)

barbs(X, Y, U, V)
Image

quiver(X, Y, U, V)

quiver(X, Y, U, V)
Image

streamplot(X, Y, U, V)

streamplot(X, Y, U, V)

Irregularly gridded data#

Plots of data \(Z_{x, y}\) on unstructured grids , unstructured coordinate grids \((x, y)\), and 2D functions \(f(x, y) = z\).

Image

tricontour(x, y, z)

tricontour(x, y, z)
Image

tricontourf(x, y, z)

tricontourf(x, y, z)
Image

tripcolor(x, y, z)

tripcolor(x, y, z)
Image

triplot(x, y)

triplot(x, y)

3D and volumetric data#

Plots of three-dimensional \((x,y,z)\), surface \(f(x,y)=z\), and volumetric \(V_{x, y, z}\) data using the mpl_toolkits.mplot3d library.

Image

bar3d(x, y, z, dx, dy, dz)

bar3d(x, y, z, dx, dy, dz)
Image

fill_between(x1, y1, z1, x2, y2, z2)

fill_between(x1, y1, z1, x2, y2, z2)
Image

plot(xs, ys, zs)

plot(xs, ys, zs)
Image

quiver(X, Y, Z, U, V, W)

quiver(X, Y, Z, U, V, W)
Image

scatter(xs, ys, zs)

scatter(xs, ys, zs)
Image

stem(x, y, z)

stem(x, y, z)
Image

plot_surface(X, Y, Z)

plot_surface(X, Y, Z)
Image

plot_trisurf(x, y, z)

plot_trisurf(x, y, z)
Image

voxels([x, y, z], filled)

voxels([x, y, z], filled)
Image

plot_wireframe(X, Y, Z)

plot_wireframe(X, Y, Z)

Gallery generated by Sphinx-Gallery