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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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