📜  matplotlib 在两点之间画一条线 - Python 代码示例

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

代码示例1
import matplotlib.pyplot as plt
# Just plot a normal line plot consisting of the two desired points
p1 = [0,3]
p2 = [1,-2]
x, y = [p1[0], p2[0]], [p1[1], p2[1]]

plt.plot(x,y)
plt.show()