Cheatography
https://cheatography.com
This sheet resume all the plot you can create with the matplotlib library
This is a draft cheat sheet. It is a work in progress and is not finished yet.
parameters
x |
data position |
y |
data position |
c |
marker color |
alpha |
transparence |
marker |
marker style |
cmap |
Color map (only used if c is an array of float) |
Basic plot
scatter |
plt.scatter(x, y, c) |
histogramme |
plt.hist(x, c, bins) |
histogramme (2D) |
plt.hist2d(x, y, cmap, bins) |
Contour plot |
plt.contour(x, y, z, [level], colors) |
Contour plot avec gradient |
plt.contourf(x, y, z, cmap) |
|
|
Marker type
. |
point |
, |
pixel |
o |
cercle |
+ |
plus |
x |
croix |
s |
square |
D |
diamond |
Complex plot
Image |
plt.imshow(x) |
nuage de point |
plt.axes(projection='3d') |
Pour un nuage de point, inclure :
from mpl.toolkits.mplot3d import Axes3D
|
|
colormap
viridis (default) |
plasma |
magma |
inferno |
seismic |
hsv |
|