Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature histogram widget #61

Closed

Conversation

haesleinhuepf
Copy link

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
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
Author

Hey @dstansby ,

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

@dstansby
Copy link
Member

dstansby commented Apr 19, 2023

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
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
Author

Correct!

Copy link
Member

@dstansby dstansby left a comment

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.

examples/feature_histogram.ipynb Outdated Show resolved Hide resolved
src/napari_matplotlib/feature_histogram.py Outdated Show resolved Hide resolved
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
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.

src/napari_matplotlib/feature_histogram.py Outdated Show resolved Hide resolved
src/napari_matplotlib/feature_histogram.py Outdated Show resolved Hide resolved
@dstansby
Copy link
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