1import matplotlib.pylot as plt
2x_coordinates = [1, 2, 3]
3
4y1_coordinates = [1, 2, 3]
5y2_coordinates = [3, 4, 5]
6
7fig = plt.figure(1)
8plt.plot(x_coordinates, y1_coordinates) # plot first line
9plt.plot(x_coordinates, y2_coordinates) # plot second line
10plt.show()
1# Short answer:
2Call plt.plot() as many times as needed to add additional lines to plot.
3
4# Example usage:
5import matplotlib.pylot as plt
6x_coordinates = [1, 2, 3]
7
8y1_coordinates = [1, 2, 3]
9y2_coordinates = [3, 4, 5]
10
11plt.plot(x_coordinates, y1_coordinates) # plot first line
12plt.plot(x_coordinates, y2_coordinates) # plot second line