Skip to main content

thin wrapper on top of matplotlib's imshow for 2D plotting with attached slice plots

Project description

sliceplots

https://img.shields.io/pypi/v/sliceplots.svg https://img.shields.io/travis/berceanu/sliceplots.svg Documentation Status Updates

thin wrapper on top of matplotlib’s .imshow() for 2D plotting, with attached slice plots

Features

  • only depends on matplotlib

  • uses its pure OO (look Ma, no pyplot!) interface

  • support for 1D and 2D plots with various customization options

  • broken-axis 1D plots

Quick start

Install the package via:

$ pip install sliceplots

Generate a quick slice plot:

import numpy as np
import sliceplots.two_dimensional as two_d

axis_data = np.linspace(0, np.pi, 128)
data_2d = np.cos(axis_data - 0.5) * np.cos(axis_data.reshape(-1, 1) - 1.0)

p2d = two_d.Plot2D(
    data_2d,
    axis_data,  # horiz. axis
    axis_data,  # vert. axis
    xlabel="x",
    ylabel="y",
    zlabel="f(x,y)",
    hslice_val=0.75,
    vslice_val=2.75,
)
p2d.fig.savefig("imshow_slices.png")
https://raw.githubusercontent.com/berceanu/sliceplots/master/tests/baseline/imshow_slices.png

Credits

Big thanks to @afvincent for his gist.

History

0.0.1 (2019-06-16)

  • First release on PyPI.

0.1.0 (2019-06-17)

  • Added regression tests, usage and docstrings.

0.1.1 (2019-06-19)

  • Fixed label positions and colors.

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

sliceplots-0.1.2.tar.gz (148.8 kB view details)

Uploaded Source

Built Distribution

sliceplots-0.1.2-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sliceplots-0.1.2.tar.gz.

File metadata

  • Download URL: sliceplots-0.1.2.tar.gz
  • Upload date:
  • Size: 148.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

File hashes

Hashes for sliceplots-0.1.2.tar.gz
Algorithm Hash digest
SHA256 24467bcc2ad3f09565ff581f0fbce7f900a9c461c3b7a5141befcd3d8c412fa0
MD5 1e2802f808db9be505f6a87259c9f777
BLAKE2b-256 d4f04fce6acec0e3491dfc4d886b0bbd8636df45281a99fb964028b3c4e1ded2

See more details on using hashes here.

File details

Details for the file sliceplots-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: sliceplots-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

File hashes

Hashes for sliceplots-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 be884744a44d50494d9a9cebfd70c3eeca8b30ae53a755a6279616e272d6bf39
MD5 8535b413e692b1747aca2e29fc3f141d
BLAKE2b-256 d47155dbd874097d5e1c4a668682b102fab8e426f73fac4ea23921f6d4a5ba55

See more details on using hashes here.

Supported by

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