2808 explained code solutions for 75 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.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities


will plot bar chart


will plot line chart


render chart in a separate window