调整matplotlib.axes.axes对象的打印范围,使原点与给定位置对齐

mpl-axes-aligner的Python项目详细描述


https://travis-ci.org/ryutok/mpl_axes_aligner.svg?branch=masterMaintainabilityTest CoveragePyPIDocumentation Statushttp://img.shields.io/badge/license-MIT-blue.svg?style=flat

概述

matplotlib axes alignermpl_axes_aligner)包包含调整matplotlib.axes.Axes对象绘图范围以对齐其原点的模块。

    {TT2}$扩展或移位MatpTLIB轴的绘图范围,以将原点与给定位置对齐。
  • mpl_axes_aligner.align调整两个matplotlib轴的绘图范围,使其原点与给定位置对齐。

用法

import numpy as np
import matplotlib.pyplot as plt
import mpl_axes_aligner

x = np.arange(0.0, 30, 0.1)
y1 = 0.1 * x * np.sin(x)
y2 = 0.001*x**3 - 0.03*x**2 + 0.12*x

fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = ax1.twinx()

ax1.plot(x, y1, color='blue', label='Plot 1')
ax2.plot(x, y2, color='red', label='Plot 2')

# Align y = 0 of ax1 and ax2 with the center of figure.
mpl_axes_aligner.align.yaxes(ax1, 0, ax2, 0, 0.5)

plt.show()
https://github.com/ryutok/mpl_axes_aligner/blob/master/docs/img/intro_plt.png?raw=true

安装

PyPI

安装
pip install mpl-axes-aligner

要求

  • python==2.7、3.4、3.5、3.6
  • matplotlib==2.2,3.0

python 3.7可能是可用的,但它没有被选中。

许可证

MIT License

作者

ryutok

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
由于测试失败,java testcontainers maven构建失败   java实现jacobi算法实现laplace方程   java中的多线程:如何在不等待所有线程使用ExecutorService完成任务的情况下终止所有线程的执行?   java Hello World不在Android Studio 3中工作   ubuntu Tomcat7的Java版本不正确   java Javafx内存泄漏   对于手动实现的Spring数据存储库方法,我应该使用Java8默认方法吗?   googleappengine中的java添加过滤查询   html当使用JSOUP库在Java中读取标签时,如何保留标签(如<br>、<ul>、<li>、<p>等)的含义?   编码为什么jasper生成的报告在Java中不显示西里尔语(保加利亚语)?   java有没有办法隐藏当前位置和jdk动作?   java找出编译原型文件的版本   有没有办法在运行时更改java方法的访问修饰符?   语法字符串。。。Java中的参数   java数组元素在添加其他元素时会相互覆盖   eclipse中的java GWT项目   java如何为spring rest模板请求将动态json属性名映射到jackson   java无法在Windows 10上找到特定的JDK   在xml字符串和java字符串之间提取正则表达式子字符串