matplotlib
画图
pyorz
python 爱好者
展开
-
matplotlib-03-实例总结
来源1来源2简单的 x,yimport numpy as npimport matplotlib.pyplot as pltt = np.arange(0.0, 2.0, 0.01)s = np.sin(2*np.pi*t)plt.plot(t, s)plt.xlabel('time (s)')plt.ylabel('voltage (mV)')plt.title('About as simple as it gets, folks')plt.grid(True)plt.show原创 2020-10-27 16:28:52 · 251 阅读 · 0 评论 -
matplotlib-02-进阶
text 和 annotate区别text() 函数在 Axes 对象的指定位置添加文本,而 annotate() 则是对某一点添加注释文本,需要考虑两个位置:一是注释点的坐标 xy ,二是注释文本的位置坐标 xytext:fig = plt.figure()ax = fig.add_subplot(111)t = np.arange(0.0, 5.0, 0.01)s = np.cos(2*np.pi*t)line, = ax.plot(t, s, lw=2)ax.annotate('lo原创 2020-10-27 15:59:18 · 317 阅读 · 1 评论 -
matplotlib-01-pyplot
整理:https://apachecn.gitee.io/ailearning/#/docs/da/081上面的图看不到,就将代码全部跑了一遍画图import numpy as npimport matplotlib.pyplot as plta=[1,2,3,4]b=[3,1,5,7]plt.plot(a,b)plt.show()颜色字符 颜色'b' 蓝色,blue'g' 绿色,green'r' 红色,red'c' 青色,cyan'm' 品红,magenta'y' 黄色原创 2020-10-27 15:06:46 · 139 阅读 · 1 评论