napari-clusters-plotter
napari-clusters-plotter copied to clipboard
Make a plotting-library
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.
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 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
We should wait until this is fixed:
- https://github.com/matplotlib/napari-matplotlib/issues/64