Matplotlib练习1

绘制直线y=2x+1

import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-,, 100)#从-11生成100个点
y = 2*x + 1
plt.plot(x, y)#将上两行中的x,y传入
plt.show()

效果图

猜你喜欢

转载自blog.csdn.net/weixin_48524215/article/details/111768764
今日推荐