Skip to main content

A simple, embeddable Matplotlib-based image viewer.

Project description

mplview

PyPI conda-forge Travis CI Read the Docs Coveralls License

A simple, embeddable Matplotlib-based image viewer.

Example

Typically mplview is used within the context of the Jupyter Notebook. Though it can also be used with any interactive GUI backend that matplotlib provides. Below is a brief example of how this works in the Jupyter Notebook with some dummy data. Similar usage can be applied to other contexts.

# Run the following in your Notebook
#
# %matplotlib notebook

import numpy as np
import matplotlib.pyplot as plt
from mplview.core import MatplotlibViewer

arr = np.random.random((25, 30, 35))

mplsv = plt.figure(FigureClass=MatplotlibViewer)
mplsv.set_images(
    arr,
    vmin=0.0,
    vmax=1.0
)

The array provided to set the images must provide a reasonable subset of the NumPy array interface (primarily slicing and coercion to NumPy Arrays). This allows other array types to be used for visualization easily (e.g. Dask Arrays).

Credits

This package was created with Cookiecutter and the nanshe-org/nanshe-cookiecutter project template.

History

0.1.0 (2016-11-01)

  • First release on PyPI.

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

mplview-0.0.6.tar.gz (31.9 kB view hashes)

Uploaded Source

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