随笔分类 -  Matplotlib

介绍Matplotlib的主要使用功能
摘要:文字和文字位置 通过plt.text()或ax.text()命令可在图形上添加文字。 Signature: ax.text(x, y, s, fontdict=None, withdash=<deprecated parameter>, **kwargs) Docstring: Add text t 阅读全文
posted @ 2022-01-08 19:56 溪奇的数据 阅读(683) 评论(0) 推荐(0)
摘要:设置颜色条 对于图形中由彩色的点、线、面构成的连续标签,用颜色条来表示的效果比较好,在Matplotlib中,颜色条是一个独立的坐标轴。 可视图形的颜色选择可参考matplotlib配色方案。 Choosing Colormaps — Matplotlib 1.4.1 documentation 重 阅读全文
posted @ 2022-01-08 19:47 溪奇的数据 阅读(2013) 评论(0) 推荐(0)
摘要:plt.legend()和ax.legend()参数设置 自动会将每条线的标签与其风格、颜色进行匹配。 plt.legend(*args, **kwargs) Place a legend on the axes. Call signatures:: legend() legend(labels) 阅读全文
posted @ 2022-01-08 19:32 溪奇的数据 阅读(1097) 评论(0) 推荐(0)
摘要:每个axes对象都有xaxis和yaxis属性,且xaxis和yaxis的每一个坐标轴都有主要刻度线/标签和次要刻度线/标签组成,标签位置通过一个Locator对象设置,标签格式通过一个Formatter设置。 plt.style.use('seaborn-whitegrid') #x轴和y轴设置成 阅读全文
posted @ 2022-01-08 18:40 溪奇的数据 阅读(4183) 评论(0) 推荐(0)
摘要:坐标轴上下限设置 plt.plot(x, np.sin(x)) #设置坐标轴上下限 plt.xlim(-1, 11) plt.ylim(-1.5, 1.5) plt.plot(x, np.sin(x)) #逆序设置坐标轴上下限 plt.xlim(10, 0) plt.ylim(1.2, -1.2) 阅读全文
posted @ 2022-01-08 18:29 溪奇的数据 阅读(1066) 评论(0) 推荐(0)
摘要:绘图函数 plt.plot()函数可以通过相应的参数设置绘图风格。 plt.plot(*args, scalex=True, scaley=True, data=None, **kwargs) Docstring: Plot y versus x as lines and/or markers. C 阅读全文
posted @ 2022-01-07 22:19 溪奇的数据 阅读(1141) 评论(0) 推荐(0)
摘要:图形剖析和构建 Matplotlib的目标对象是用Python对象表示任意图形元素。Figure对象可以看作盛放图形元素的包围盒,其他的Matplotlib对象(Axes、Title、Grid、Spines、XY axis label and tick(Minor and Major)、Line(S 阅读全文
posted @ 2022-01-07 21:51 溪奇的数据 阅读(96) 评论(0) 推荐(0)
摘要:Matplotlib 是建立在Numpy数组基础上的多平台数据可视化程序库,最重要的特性之一就是具有良好的操作系统兼容性和图形显示底层接口兼容性,并支持几十种图形显示接口与输出格式,功能较完善、跨平台的画图引擎。 官方网站:Matplotlib: Python plotting — Matplotl 阅读全文
posted @ 2022-01-07 21:41 溪奇的数据 阅读(642) 评论(0) 推荐(0)