9951 explained code solutions for 126 technologies

python-matplotlibHow to draw multiple lines

Plotting multiple lines is as simple as calling plt.plot() method multiple times. Let's plot 2 lines:

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

loads Matplotlib module to use plotting capabilities


plot specified data


values to use for first line


values to use for second line


render chart in a separate window