napari-plot

napari-plot

Plugin providing support for 1d plotting in napari.

License PyPI Python Version tests codecov

Plugin providing support for 1d plotting in napari.

This plugin is in very early stages of development and many things are still in a state of disarray. New features and bug fixes will be coming over the coming months.

Note

napari-plot provides several custom icons and stylesheets to take advantage of the Qt backend. Since it would be a bit busy to add multiple layer lists, I opted to include a toolbar that quickly pulls the layer list whenever requested. Simple use the toolbar to access several commonly accessed elements.

Usage

You can use napari-plot alongside napari where it is embedded as a dock widget. If using this option, controls are relegated to toolbar where you can adjust layer properties like you would do in napari.

embedded

Or as a standalone app where only one-dimensional plotting is enabled. In this mode, controls take central stage and reflect napari's own behaviour where layer controls are embedded in the main application.

live-view

Roadmap:

This is only provisional list of features that I would like to see implemented. It barely scratches the surface of what plotting tool should cover so as soon as the basics are covered, focus will be put towards adding more exotic features. If there are features that you certainly wish to be included, please modify the list below or create a new issue

  • Support for new layer types. Layers are based on napari's Layer, albeit in a two-dimensional setting. Supported and planned layers:
    • Line Layer - simple line plot.
    • Scatter Layer - scatter plot (similar to napari's Points layer).
    • Centroids/Segments Layer - horizontal or vertical line segments.
    • InfLine Layer - infinite horizontal or vertical lines that span over very broad range. Useful for defining regions of interest.
    • Region Layer - infinite horizontal or vertical rectangular boxes that span over very broad range. Useful for defining regions of interest.
    • Shapes Layer - napari's own Shapes layer
    • Points Layer - napari's own Points layer
    • Multi-line Layer - more efficient implementation of Line layer when multiple lines are necessary.
    • Bar - horizontal and vertical barchart (TODO)
  • Proper interactivity of each layer type (e.g. moving Region or InfLine, adding points, etc...)
  • Intuitive interactivity. napari-plot will provide excellent level of interactivity with the plotted data. We plan to support several types of Tools that permit efficient interrogation of the data. We currently provide several zoom and select tools and hope to add few extras in the future.
    • Box-zoom - standard zooming rectangle. Simply left-mouse + drag/release in the canvas on region of interest
    • Horizontal span - zoom-in only in the y-axis by Ctrl + left-mouse + drag/release in the canvas.
    • Vertical span - span-in only in the x-axis by Shift + left-mouse + drag/release in the canvas.
    • Rectangle select - rectangle tool allowing sub-selection of data in the canvas. Similar to the Box-zoom but without the zooming part.
    • Polygon select - polygon tool allowing sub-selection of data in the canvas.
    • Lasso select - lasso tool allowing sub-selection of data in the canvas.
  • Interactive plot legend
  • Customizable axis visuals.
    • Plot axis enabling customization of tick/label size and color
    • Support for non-linear scale
  • Add convenient plotting interface:
    • Add .plot functionality
    • Add .scatter functionality
    • Add .hbar and .vbar functionality
    • Add .imshow functionality

This napari plugin was generated with Cookiecutter using with @napari's cookiecutter-napari-plugin template.

Installation

You can install napari-plot directly from PyPI via:

pip install napari-plot

or from the git repo:

git clone https://github.com/lukasz-migas/napari-1d.git
cd napari-1d
pip install -e '.[all]'

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

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

Issues

If you encounter any problems, please file an issue along with a detailed description.

Version:

  • 0.1.5

Last updated:

  • 22 March 2022

First released:

  • 09 January 2022

License:

Supported data:

  • Information not submitted

Plugin type:

GitHub activity:

  • Stars: 24
  • Forks: 2
  • Issues + PRs: 36

Python versions supported:

Operating system:

Requirements:

  • napari-plugin-engine (>=0.1.4)
  • numpy
  • qtpy
  • qtawesome
  • napari (<0.4.15,>=0.4.13)
  • matplotlib
  • vispy (>=0.9.6)

Sign up to receive updates