📜  python在同一图中绘制多条线 - Python代码示例

📅  最后修改于: 2022-03-11 14:46:36.201000             🧑  作者: Mango

代码示例1
# Short answer:
Call plt.plot() as many times as needed to add additional lines to plot.

# Example usage:
import matplotlib.pylot as plt
x_coordinates = [1, 2, 3]

y1_coordinates = [1, 2, 3]
y2_coordinates = [3, 4, 5]

plt.plot(x_coordinates, y1_coordinates) # plot first line
plt.plot(x_coordinates, y2_coordinates) # plot second line