Exercise

Give the Python code matplotlib which draws the line D (A, B) passing through the two points A (1,2) and B (2,3).

Solution

import numpy as np
import matplotlib.pyplot as plt
# Let's drow the line D(A(1,2) ,B(2,3))
x = np.array([1 , 2])
y = np.array([2 , 3])

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

Younes Derfoufi
my-courses.net

Leave a Reply