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

Implement Histogram1D if the same measurement is selected for both axes #237

Merged
merged 23 commits into from
Apr 29, 2023

Conversation

lazigu
Copy link
Collaborator

@lazigu lazigu commented Mar 30, 2023

This PR implements plotting 1D histogram if the same measurement is selected for both axes. Currently, no clustering for this type of histogram is implemented. @zoccoler had an idea that clustering for such a histogram could be done with a span selector (the issue has not been created yet).
Partly closes #151, however, a separate issue regarding clustering 1D histograms should be created.

@lazigu lazigu requested a review from zoccoler March 30, 2023 16:28
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #237 (09414ca) into main (3a9edf9) will decrease coverage by 6.67%.
The diff coverage is 18.26%.

@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
- Coverage   82.30%   75.63%   -6.67%     
==========================================
  Files          14       14              
  Lines        1565     1650      +85     
==========================================
- Hits         1288     1248      -40     
- Misses        277      402     +125     
Impacted Files Coverage Δ
napari_clusters_plotter/_plotter_utilities.py 68.21% <12.00%> (-23.13%) ⬇️
napari_clusters_plotter/_plotter.py 65.83% <17.14%> (-10.49%) ⬇️
napari_clusters_plotter/_Qt_code.py 61.01% <19.04%> (-13.11%) ⬇️
napari_clusters_plotter/_tests/test_plotter.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

- histogram colors still need to be updated (something like this may work: https://stackoverflow.com/a/49290555/11885372)
@zoccoler
Copy link
Collaborator

Hi @lazigu , sorry for the delay!
I am implementing the span selector in this PR, so that it becomes complete.

@zoccoler
Copy link
Collaborator

The histogram still needs to be painted back with the right colors. As metnioned in the commit, somthing like this may work: https://stackoverflow.com/a/49290555/11885372

This is a work in progress.

@zoccoler
Copy link
Collaborator

Hi @lazigu, hi everyone, the span selection should be working now. The histogram colors now also get updated, having a similar behavior to the other plotting options (histogram 2d and scatter).

I renamed the HISTOGRAM_2D to just HISTOGRAM now. Whether it is 2D or not comes from the selected measurements.

If both measurements are the same, the histogram is 1D and a span selector is used instead of the lasso. Right-click should reset the clusters.

Could someone test before merging?

Best,
Marcelo

@zoccoler zoccoler added this to the v0.7.0 milestone Apr 26, 2023
@haesleinhuepf
Copy link
Member

I love it!

image

@haesleinhuepf haesleinhuepf merged commit 2a8774c into main Apr 29, 2023
@haesleinhuepf haesleinhuepf deleted the histogram1d branch April 29, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Histograms
3 participants