Adjust the plotting range of matplotlib.axes.Axes objects to align the origins with the given position
Project description
Overview
Matplotlib axes aligner (mpl_axes_aligner) package contains the modules which adjust the plotting range of matplotlib.axes.Axes objects to align their origins.
mpl_axes_aligner.shift expands or shifts the plotting range of a matplotlib axis to align the origin with the given position.
mpl_axes_aligner.align adjust the plotting range of two matplotlib axes to align their origins with the given position.
Usage
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()
Documentation
Installation
Install from PyPI:
pip install mpl-axes-aligner
Requirements
Python == 2.7, 3.4, 3.5, 3.6
Matplotlib == 2.2, 3.0
Python 3.7 may be available, but it is not checked.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mpl_axes_aligner-1.1.tar.gz
.
File metadata
- Download URL: mpl_axes_aligner-1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9c5a6983a3b2f772f470b4889df883ae56c3b5ab5fc4a8fa3e71440922c87ed |
|
MD5 | b7656196a1832e55184560a8edd74b3c |
|
BLAKE2b-256 | bb03d211088e74f1622bc2641b2582fa4482d390a50a28eef3d8e327e8434e3e |
File details
Details for the file mpl_axes_aligner-1.1-py3-none-any.whl
.
File metadata
- Download URL: mpl_axes_aligner-1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4a8e504871ee82158fadcbdee413a096e24ea7c01bd95096df001d9971ac33f |
|
MD5 | ff78c96d662392cc750c5085d72c5145 |
|
BLAKE2b-256 | 381f2b1bbc8b63581af8597537c1a34a9b36e8c9f0112ffecaa932861b628fa0 |