Skip to main content

A split module for easily generating matplotlib figures with split x axes

Project description

Simple Split X axes for matplotlib

Use gridspec to generate nxm grids of figures where the x axis on each figure may be an split arbitrary number of times.

The axes object presented by this package is similar (though not identical) to the axes object presented by matplotlib. This allows for a good amount of plotting code to be directly ported.

Installation

From source

git clone https://github.com/tboudreaux/splitAxes.git
cd splitAxes
pip instal -e .

From PyPi

pip install splitAxes

Examples

from splitAxes import split_grid
import numpy as np
import matplotlib.pyplot as plt

figRows = 2
figColums = 2

# this is a matrix of size rows x colums. Each entry in the matrix is the number of splits (NOT the number of final panels, which will be 1 + the number of splits) to generate

splitMatrix=np.array([[3,1],[0,2]])

fig, axs = split_grid(figRows, figColums, splitMatrix, figsize=(15,7))

# Example Data
X = np.linspace(-10,50, 1000)
Y = np.exp(-(X-0)**2) + np.exp(-(X-10)**2) + np.exp(-(X-20)**2)

axs[0,0].set_xlim(0,45)
axs[0,0].set_ylabel("Bob")
axs[1,0].plot(X,Y, color='green')
axs[1,1].scatter([0,3,4],[5,4,2])
axs[0,1].set_xlabel("Dave", position="manual", labelpos=0.67)

axs[1,0].fill_between([0,10], 0.3, alpha=0.5, color='blue')

plt.show()

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

splitAxes-0.9.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splitAxes-0.9.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file splitAxes-0.9.0.tar.gz.

File metadata

  • Download URL: splitAxes-0.9.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for splitAxes-0.9.0.tar.gz
Algorithm Hash digest
SHA256 b2a761a40964e85cf94a91d68522ced484fa392f75ec7e1271087086791fd0cc
MD5 9b3d2f72c7faaf2e707337ff13c63a10
BLAKE2b-256 5d4db124d892deb9ccf93943ec16944b4018b9a9a600008812b8eeee2de2c110

See more details on using hashes here.

File details

Details for the file splitAxes-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: splitAxes-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for splitAxes-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3551a4400e6c960fd56e9e9ba511f70daf0c08c8c1af6a52ff75ec7f449c7a0a
MD5 043715986cffd1b1b070d53bdaa6ad73
BLAKE2b-256 96f2078520564da8fdd28df43360d3602dee36c6787fe54a20c548437d1c689e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page