摘要: 文字和文字位置 通过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 溪奇的数据 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 设置颜色条 对于图形中由彩色的点、线、面构成的连续标签,用颜色条来表示的效果比较好,在Matplotlib中,颜色条是一个独立的坐标轴。 可视图形的颜色选择可参考matplotlib配色方案。 Choosing Colormaps — Matplotlib 1.4.1 documentation 重 阅读全文
posted @ 2022-01-08 19:47 溪奇的数据 阅读(1756) 评论(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 溪奇的数据 阅读(928) 评论(0) 推荐(0) 编辑
摘要: 每个axes对象都有xaxis和yaxis属性,且xaxis和yaxis的每一个坐标轴都有主要刻度线/标签和次要刻度线/标签组成,标签位置通过一个Locator对象设置,标签格式通过一个Formatter设置。 plt.style.use('seaborn-whitegrid') #x轴和y轴设置成 阅读全文
posted @ 2022-01-08 18:40 溪奇的数据 阅读(3714) 评论(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 溪奇的数据 阅读(885) 评论(0) 推荐(0) 编辑