Answers for "matplotlib draw a line between two points"

0

matplotlib draw a line between two points

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()
Posted by: Guest on September-06-2021

Code answers related to "matplotlib draw a line between two points"

Python Answers by Framework

Browse Popular Code Answers by Language