1. 程式人生 > >matplotlib初試——求兩條直線相交的大概位置

matplotlib初試——求兩條直線相交的大概位置

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0,1,10)
y = (0.45-0.4*x)/0.6
z = 0.48*x/0.35

plt.figure(figsize = (8,4))

plt.plot(x,y,color="red")
plt.plot(x,z,"b--")

plt.legend()
plt.show()