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

Consistent bin-width in histograms summarising multiple images #524

Merged
merged 2 commits into from
Apr 14, 2023

Conversation

ns-rse
Copy link
Collaborator

@ns-rse ns-rse commented Apr 12, 2023

Closes #479

Contrary to the title plotting.py, which uses Seaborn, produces consistent bin-width when the range of values differs between images. The Jupyter Notebook (notebooks/02-Summary-statistics-and-plots.ipynb) uses Pandas for loading data and plotting it (a deliberate choice to reduce the number of packages users would encounter) and it is Pandas which produces the different bin-widths (see #22222 ENH: groupby.hist bins don't match).

The Notebook has been updated to show how to use np.linspace() across the total range of data.

Docstrings of tests/test_plotting.py have also been improved.

Closes #479

Contrary to the title `plotting.py`, which uses Seaborn, produces consistent bin-width when the range of values differs
between images. The Jupyter Notebook (`notebooks/02-Summary-statistics-and-plots.ipynb`) uses Pandas for loading data
and plotting it (a deliberate choice to reduce the number of packages users would encounter) and it is Pandas which
produces the different bin-widths (see [#22222 ENH: groupby.hist bins don't
match](pandas-dev/pandas#22222)).

The Notebook has been updated to show how to use `np.linspace()` across the total range of data.

Docstrings of `tests/test_plotting.py` have also been improved.
@ns-rse ns-rse added the Plotting Issues pertaining to the plotting class label Apr 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.06 🎉

Comparison is base (bfe0cda) 80.02% compared to head (805507e) 80.08%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
+ Coverage   80.02%   80.08%   +0.06%     
==========================================
  Files          19       19              
  Lines        2783     2792       +9     
==========================================
+ Hits         2227     2236       +9     
  Misses        556      556              
Impacted Files Coverage Δ
topostats/io.py 80.95% <100.00%> (+0.49%) ⬆️
topostats/processing.py 89.93% <100.00%> (+0.06%) ⬆️
topostats/run_topostats.py 84.67% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@SylviaWhittle SylviaWhittle left a comment

Choose a reason for hiding this comment

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

A useful clarification 😄

Copy link
Collaborator

@Jean-Du Jean-Du left a comment

Choose a reason for hiding this comment

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

This looks great and should clear things up! I am just wondering whether the commented out lines 296 and 297 are meant to be cleaned up?

@ns-rse ns-rse merged commit 8b0e80e into main Apr 14, 2023
@ns-rse
Copy link
Collaborator Author

ns-rse commented Apr 14, 2023

Good catches on the commented code and grammar @Jean-Du thanks.

Thanks for the approval @SylviaWhittle

Merged 🎉

@ns-rse ns-rse deleted the ns-rse/479-bin-width branch April 14, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plotting Issues pertaining to the plotting class
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistent bindwidth in histograms from plotting.py
5 participants