Skip to content

Add feature histogram widget#61

Closed
haesleinhuepf wants to merge 12 commits into
matplotlib:mainfrom
haesleinhuepf:add_feature_histograms
Closed

Add feature histogram widget#61
haesleinhuepf wants to merge 12 commits into
matplotlib:mainfrom
haesleinhuepf:add_feature_histograms

Conversation

@haesleinhuepf

Copy link
Copy Markdown

Hi @dstansby ,

this adds a FeatureHistogramWidget to napari-matplotlib to visualize quantitative measurements that have been stored in labels layers in napari. If that's out of scope, no problem, we could easily also put this code in napari-clusters-plotter or napari-skimage-regionprops. I just thought it fits best here.

image

Let me know what you think. Thanks!

Best,
Robert

@dstansby

Copy link
Copy Markdown
Member

Thanks for opening this PR - I'm busy with other projects at the moment (sorry 😞 ), but have funding to work on napari-matplotlib at the beginning of 2023, so I will get back to you then - at a glance this looks like a nice feature to have though 😃

@haesleinhuepf

Copy link
Copy Markdown
Author

Hey @dstansby ,

thanks for your reply and congratulations to the grant! There's no hurry. Looking forward to 2023 🙌

@dstansby

dstansby commented Apr 19, 2023

Copy link
Copy Markdown
Member

Just coming back to napari-matplotlib now. To clarify, does this widget just plot a histogram of the number of times each label value appears in a Labels layer?

@dstansby

Copy link
Copy Markdown
Member

Ah woops, I got that wrong above 😆 . Am I correct in understanding that this provides a histogram of the values in individual columns of a pandas.DataFrame, that is stored as the .features attribute on a napari layer?

@haesleinhuepf

Copy link
Copy Markdown
Author

Correct!

@dstansby dstansby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks 👍 overall. I've left a few requests to remove stuff, that we should consider more generally for all the plots napari-matplotlib produces.

Comment thread examples/feature_histogram.ipynb Outdated
Comment thread src/napari_matplotlib/feature_histogram.py Outdated
Comment on lines +32 to +35
# Logarithmic plot yes/no
self.logarithmic_plot = QCheckBox("Logarithmic")
self.logarithmic_plot.stateChanged.connect(self._draw)
self.layout().addWidget(self.logarithmic_plot)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this for now? Having a log-axes option is more widely applicable to all the plots napari-matplotlib produces, so I'd like to think about it in more general terms. Would be good to open an issue with this as a feature request so we can discuss a bit before implementing it.

Comment thread src/napari_matplotlib/feature_histogram.py Outdated
Comment thread src/napari_matplotlib/feature_histogram.py Outdated
@dstansby

Copy link
Copy Markdown
Member

I'm going to close this in favour of #148

@dstansby dstansby closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants