A simple, embeddable Matplotlib-based image viewer.
Project description
mplview
A simple, embeddable Matplotlib-based image viewer.
Free software: BSD 3-Clause
Documentation: https://mplview.readthedocs.io.
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
File details
Details for the file mplview-0.0.6.tar.gz
.
File metadata
- Download URL: mplview-0.0.6.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9edddd9bfd6397fe39fd70c9f5e152354a2b04a0f253e869135eb009b09222fa |
|
MD5 | 02daaa6866cc4b3ee2af411426375bdd |
|
BLAKE2b-256 | d23695b728a55765396319fb85b8faea3adca145e770d00d44d3be8052004471 |