Metadata-Version: 2.4
Name: napari_plot
Version: 0.5.0
Summary: Plugin providing support for 1d plotting in napari
Author-email: Lukasz Migas <lukas.migas@yahoo.com>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/lukasz-migas/napari-plot
Project-URL: Download, https://github.com/lukasz-migas/napari-plot
Project-URL: Bug Tracker, https://github.com/lukasz-migas/napari-plot/issues
Project-URL: Documentation, https://lukasz-migas.github.io/napari-plot/
Project-URL: Source Code, https://github.com/lukasz-migas/napari-plot
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Utilities
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: Framework :: napari
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: qtpy
Requires-Dist: qtawesome==1.4.2
Requires-Dist: napari<0.11,>=0.10
Requires-Dist: vispy
Requires-Dist: koyo
Requires-Dist: qtextra
Requires-Dist: fonttools<=4.68.0
Provides-Extra: stats
Requires-Dist: matplotlib; extra == "stats"
Requires-Dist: pandas<4,>=2.2; extra == "stats"
Requires-Dist: scipy; extra == "stats"
Requires-Dist: seaborn<0.14,>=0.13.2; extra == "stats"
Provides-Extra: pyside6
Requires-Dist: napari[pyside6]<0.11,>=0.10; extra == "pyside6"
Requires-Dist: pyside6!=6.12.0; python_version < "3.12" and extra == "pyside6"
Requires-Dist: pyside6>6.9.0; platform_system == "Windows" and extra == "pyside6"
Requires-Dist: pyside6; platform_system != "Windows" and extra == "pyside6"
Provides-Extra: pyside
Requires-Dist: napari_plot[pyside6]; extra == "pyside"
Provides-Extra: pyqt6
Requires-Dist: napari[pyqt6]<0.11,>=0.10; extra == "pyqt6"
Requires-Dist: pyqt6>=6.9.0; extra == "pyqt6"
Requires-Dist: pyqt6!=6.6.1; platform_system == "Darwin" and extra == "pyqt6"
Provides-Extra: pyqt
Requires-Dist: napari_plot[pyqt6]; extra == "pyqt"
Provides-Extra: qt
Requires-Dist: napari_plot[pyqt]; extra == "qt"
Provides-Extra: all
Requires-Dist: napari_plot[optional,pyqt,stats]; extra == "all"
Requires-Dist: napari-plugin-manager<0.2.0,>=0.1.10; extra == "all"
Provides-Extra: optional
Requires-Dist: triangle; platform_machine != "arm64" and extra == "optional"
Requires-Dist: numba>=0.57.1; extra == "optional"
Requires-Dist: zarr>=2.12.0; extra == "optional"
Provides-Extra: test
Requires-Dist: babel>=2.9.0; extra == "test"
Requires-Dist: fsspec>=2023.10.0; extra == "test"
Requires-Dist: hypothesis>=6.8.0; extra == "test"
Requires-Dist: lxml[html_clean]>5; extra == "test"
Requires-Dist: napari_plot[stats]; extra == "test"
Requires-Dist: numba>=0.57.1; extra == "test"
Requires-Dist: pooch>=1.6.0; extra == "test"
Requires-Dist: coverage>7; extra == "test"
Requires-Dist: docstring_parser>=0.15; extra == "test"
Requires-Dist: pretend>=1.0.9; extra == "test"
Requires-Dist: pyautogui>=0.9.54; extra == "test"
Requires-Dist: pytest-cov>=5.0.0; extra == "test"
Requires-Dist: pytest-qt>=4.3.1; extra == "test"
Requires-Dist: pytest-pretty>=1.1.0; extra == "test"
Requires-Dist: pytest>=8.1.0; extra == "test"
Requires-Dist: pytest-xdist>=3.5.0; extra == "test"
Requires-Dist: tensorstore>=0.1.13; extra == "test"
Requires-Dist: xarray>=0.16.2; extra == "test"
Requires-Dist: zarr<3.0.0,>=2.12.0; extra == "test"
Requires-Dist: IPython>=7.25.0; extra == "test"
Requires-Dist: qtconsole>=4.5.1; extra == "test"
Requires-Dist: rich>=12.0.0; extra == "test"
Requires-Dist: napari-plugin-manager<0.2.0,>=0.1.10; extra == "test"
Provides-Extra: test-extra
Requires-Dist: torch>=1.7; extra == "test-extra"
Provides-Extra: release
Requires-Dist: PyGithub>=1.44.1; extra == "release"
Requires-Dist: twine>=3.1.1; extra == "release"
Requires-Dist: gitpython>=3.1.0; extra == "release"
Requires-Dist: requests-cache>=0.9.2; extra == "release"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pdbpp; extra == "dev"
Requires-Dist: check-manifest>=0.42; extra == "dev"
Requires-Dist: pre-commit>=2.9.0; extra == "dev"
Requires-Dist: pydantic; extra == "dev"
Requires-Dist: napari_plot[test]; extra == "dev"
Provides-Extra: build
Requires-Dist: ruff; extra == "build"
Requires-Dist: pyqt6; extra == "build"
Provides-Extra: docs
Requires-Dist: zensical>=0.1.3; extra == "docs"
Requires-Dist: mkdocstrings-python; extra == "docs"
Requires-Dist: napari_plot[stats]; extra == "docs"
Dynamic: license-file

# napari-plot

[![License](https://img.shields.io/pypi/l/napari-plot.svg?color=green)](https://github.com/lukasz-migas/napari-plot/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-plot.svg?color=green)](https://pypi.org/project/napari-plot)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/napari-plot/badges/version.svg)](https://anaconda.org/conda-forge/napari-plot)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-plot.svg?color=green)](https://python.org)
[![tests](https://github.com/lukasz-migas/napari-plot/workflows/tests/badge.svg)](https://github.com/lukasz-migas/napari-plot/actions)
[![codecov](https://codecov.io/gh/lukasz-migas/napari-plot/branch/main/graph/badge.svg)](https://codecov.io/gh/lukasz-migas/napari-plot)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/napari-plot.svg)](https://pypistats.org/packages/napari-plot)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-plot)](https://www.napari-hub.org/plugins/napari-plot)
[![Documentation](https://github.com/lukasz-migas/napari-plot/actions/workflows/docs.yml/badge.svg)](https://lukasz-migas.github.io/napari-plot/)

## 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](https://github.com/lukasz-migas/napari-plot/raw/main/misc/standalone.png)

## See it in action

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

![napari-plot embedded in napari](https://github.com/lukasz-migas/napari-plot/raw/main/misc/embedded.png)

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

![Grid plots with independent panels](https://github.com/lukasz-migas/napari-plot/raw/main/docs/assets/gallery/examples-show_grid_mode.jpg)

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

![Statistical violin plots](https://github.com/lukasz-migas/napari-plot/raw/main/docs/assets/gallery/examples-stats_violinplot.jpg)

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](https://github.com/lukasz-migas/napari-plot/raw/main/docs/assets/gallery/examples-select_data.jpg)

Browse the [example gallery](https://lukasz-migas.github.io/napari-plot/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.

```shell
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:

```python
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:

```python
import napari
from napari_plot import NapariPlotWidget

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

## Documentation

See the [quickstart](https://lukasz-migas.github.io/napari-plot/), [layer guide](https://lukasz-migas.github.io/napari-plot/layers/),
[examples](https://lukasz-migas.github.io/napari-plot/examples/), and [API reference](https://lukasz-migas.github.io/napari-plot/api/).

## Contributing

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

```shell
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](https://github.com/lukasz-migas/napari-plot/issues) with a detailed description.
This project is supported by a Chan-Zuckerberg Initiative [napari](https://chanzuckerberg.com/science/programs-resources/imaging/napari/maintain-1d-visualization-plugin/) grant.

[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[uv]: https://docs.astral.sh/uv/
