Skip to main content

Create broken axes

Project description

brokenaxes makes matplotlib plots with breaks in the axes for showing data across a discontinuous range.

* Break x and/or y axes.
* Supports multiple breaks on a single axis.
* Automatically scales axes according to relative ranges.
* Plot multiple lines.
* Legend with positioning relative to entire broken axes object
* x and y label centered to entire x and y plot
* Make brokenaxes object a subplot itself with subplot_spec from GridSpec.

Example usage:

import matplotlib.pyplot as plt
from brokenaxes import brokenaxes
import numpy as np

fig = plt.figure(figsize=(5,2))
bax = brokenaxes(xlims=((0, .1), (.4, .7)), ylims=((-1, .7), (.79, 1)), hspace=.05)
x = np.linspace(0, 1, 100)
bax.plot(x, np.sin(10 * x), label='sin')
bax.plot(x, np.cos(10 * x), label='cos')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for brokenaxes, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size brokenaxes-0.1.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View
Filename, size brokenaxes-0.1-py2.py3-none-any.whl (2.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page