Show Menu
Cheatography

Matplotlib Cheat Sheet (DRAFT) by

a cheatsheet of matplotlib syntax

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Initia­lising

import matplotlib.pyplot as plt
#
plt.show()

Line Graph

#Label helps with showing legend
plt.plot(x, y, label= 1)
#Stacking
plt.plot(x2, y2, label= 2)
 

Custom­ising

#Add title
plt.title("Title")
#axis labels
plt.xlabel('xLabel')
plt.ylabel('yLabel')

ww

a
a