import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-1,1,100)
y1 = 2*x + 1
y2 = x**2
plt.figure()#创建第一个图
plt.plot(x,y1)
plt.figure()#创建第二个图
plt.plot(x,y2)
plt.show()
相关文章:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-1,1,100)
y1 = 2*x + 1
y2 = x**2
plt.figure()#创建第一个图
plt.plot(x,y1)
plt.figure()#创建第二个图
plt.plot(x,y2)
plt.show()
相关文章: