pyplot模块
绘制简单的折线图
import matplotlib.pyplot as plt
squares = [1, 4, 9, 16, 25]
plt.plot(squares)
plt.show()
效果如下:
模块pyplot包含很多用于生成图表的函数。
函数plot()尝试根据这些数字绘制出有意义的图形
函数show()打开matplotlib查看器,并显示绘制的图形
修改标签文字和线条粗细
import matplotlib.pyplot as plt
squares = [1, 4, 9, 16,
原创
2021-07-20 15:03:31 ·
548 阅读 ·
0 评论