napari-clusters-plotter icon indicating copy to clipboard operation
napari-clusters-plotter copied to clipboard

Make a plotting-library

Open haesleinhuepf opened this issue 3 years ago • 3 comments
trafficstars

Hi all,

we were recently discussing how to make the plotting-code available to other napari-plugins and reuse code instead of copy&pasting it.

Today, napari-matplotlib was released. The base class in there might be pretty much a basic version of what we were discussing. Thus, before starting something, it might make sense to test if napari-matplotlib fulfills our needs and/or find out what's missing.

haesleinhuepf avatar May 02 '22 14:05 haesleinhuepf

I added two PRs to napari-matplotlib that, at the very least, make it compliant (style-wise) with what we are doing in the clusters plotter. In that sense, we could already use the base class from there to replace the code here.

For more advanced visualization, I think what we are looking for is very similar to what is discussed in this issue. The basic idea is to extend napari-matplotlib to be a viewer on layer.properties or layer.features.

We could, for instance:

  • Create and visualize measurements in the Table from napari-skimage-regionprops
  • Connect selecting columns in the Table Widget to visualization with napari-matplotlib
  • Connect the lasso tools from the clusters plotter to the canvas provided by napari-matplotlib

and end up with the same functionality as we have right now but with considerably less code and hand-designed widgets :)

jo-mueller avatar May 06 '22 09:05 jo-mueller

@jo-mueller I really like this idea and I'm all for reducing the code in the plotting widget since this widget is the most difficult to read. Maybe as soon as we have a stable release of napari-matplotlib with the functionality you are suggesting we can start to integrate napari matplotlib into the cluster plotter

Cryaaa avatar May 09 '22 08:05 Cryaaa

We should wait until this is fixed:

  • https://github.com/matplotlib/napari-matplotlib/issues/64

haesleinhuepf avatar Feb 22 '23 08:02 haesleinhuepf