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.

Files for mplview, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size mplview-0.0.6.tar.gz (31.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page