9951 explained code solutions for 126 technologies


python-matplotlibHow to add multiple plots on a single figure


You can add multiple plots by calling plotting methods (e.g. plot(), bar(),...) multiple times:

import matplotlib.pyplot as plt

plt.bar(['a', 'b', 'c'], [3,4,2])
plt.plot([4,9,6])

plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.bar

will plot bar chart

.plot(

will plot line chart

.show()

render chart in a separate window