Skip to main content

napari-plot

License PyPI Anaconda-Server Badge Python Version tests codecov pre-commit PyPI - Downloads napari hub Documentation

Interactive plotting in napari and Qt

napari-plot is a GPU-accelerated plotting library for interactive one-dimensional data visualization. Use it as a dock widget in napari or open its standalone Qt viewer. Build plots from familiar layers, update them as data changes, and inspect values with selection tools.

Standalone napari-plot viewer

See it in action

The same plot viewer can be embedded in napari alongside image and annotation layers:

napari-plot embedded in napari

Compare channels or measurements with grid layouts, independently configurable axes, and colorbars:

Grid plots with independent panels

Statistical plots include categorical distributions and relational plots. Install the stats extra to use them:

Statistical violin plots

Selection tools can report the data points and layer indices inside a box, lasso, or polygon selection:

Selecting data in a napari-plot scatter plot

Browse the example gallery for more screenshots and runnable code.

Current capabilities

  • Plot layers: Line, Scatter, MultiLine, Centroids, Bar, Band, ErrorBar, Region, InfLine, Rectangles, Text, and Image.
  • Axes and layout: linear, logarithmic, categorical, and datetime axes; grid views; plot annotations; legends and colorbars.
  • Interaction: box, lasso, and polygon selection; editable layers; live updates; and shared layer controls in napari.
  • Statistics: seaborn-style relational, categorical, distribution, matrix, and faceted plots through the optional stats extra.
  • Files: export figures as PNG, SVG, or PDF; export layer data; and save or restore plot sessions.

Quick start

Install napari-plot with one Qt6 backend. Python 3.11 or later and napari 0.10.x are required.

pip install "napari-plot[pyqt6]"

For PySide6, use napari-plot[pyside6]. Add ,stats to either extra to install statistical plotting support.

Create a plot in the standalone viewer:

import numpy as np
import napari_plot

viewer = napari_plot.Viewer(title="Signal")
x = np.linspace(0, 2 * np.pi, 500)
y = np.sin(x)

viewer.plot(x, y, name="signal", color="cyan")
viewer.scatter(x[::25], y[::25], name="samples", size=8)
viewer.axis.x_label = "Time (s)"
viewer.axis.y_label = "Amplitude"
viewer.legend.visible = True

napari_plot.run()

To open it inside napari, add the Plot Widget from Plugins > napari-plot: Plot Widget, or create it in Python:

import napari
from napari_plot import NapariPlotWidget

viewer = napari.Viewer()
viewer.window.add_dock_widget(NapariPlotWidget(viewer))
napari.run()

Documentation

See the quickstart, layer guide, examples, and API reference.

Contributing

Contributions are welcome. Install the test environment and run the tests with uv:

uv sync --no-dev --group test --extra pyqt6 --extra optional
uv run --no-sync pytest

License

Distributed under the terms of the BSD-3 license, napari-plot is free and open source software.

Issues and support

If you encounter a problem, file an issue with a detailed description. This project is supported by a Chan-Zuckerberg Initiative napari grant.

Metadata

Release files for napari-plot 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-plot 0.5.0
File Size Uploaded Provenance Actions
napari_plot-0.5.0.tar.gz 632.2 kB Without provenance Details for napari_plot-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napari-plot 0.5.0
File Interpreter ABI Platform Actions
napari_plot-0.5.0-py3-none-any.whl Python 3 none any Details for napari_plot-0.5.0-py3-none-any.whl

Total release size: 1.3 MB

Release files / napari_plot-0.5.0.tar.gz

Download URL napari_plot-0.5.0.tar.gz
Size 632.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ee5d552d3db85a8a2900193344a9cf849c2471a789339e61d3592754609301e5
BLAKE2b-256 checksum
How to use checksums
abcdd5a75ed0099768582633f5ea856ac95eea62251d62c3d1aa8b12579be8ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / napari_plot-0.5.0-py3-none-any.whl

Download URL napari_plot-0.5.0-py3-none-any.whl
Size 698.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2660f5c54de142f15e447d8253e248f2a198da8e010b18a47c85d76fafad6fc
BLAKE2b-256 checksum
How to use checksums
1d3fc80eb4a5e6228e7a2ae1b4af64ba626d2b18f6f96b3ec41a111dd0b066ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for napari-plot 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page