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

adapt histograms to float/int #2247

Merged
merged 5 commits into from
Jun 10, 2023
Merged

adapt histograms to float/int #2247

merged 5 commits into from
Jun 10, 2023

Conversation

OriolAbril
Copy link
Member

@OriolAbril OriolAbril commented Jun 7, 2023

Description

The align="left" we used as default in matplotlib distplot is great for ints, but super confusing
for floats (which are also valid histogram input via kind kwarg and/or rcparam). The plot
below shows the issue:

imatge

bokeh distplot used a mid/centered bins approach which is great for floats, but
requires remembering that intervals are [left_edge, right_edge) for ints. Now both
should behave in the same way, in both cases plotting histograms adapted to the dtype
of the input.

Checklist

  • Does the PR follow official PR format?
  • Is the code style correct (follows pylint and black guidelines)?
  • Is the fix listed in the Maintenance and fixes section of the changelog?

📚 Documentation preview 📚: https://arviz--2247.org.readthedocs.build/en/2247/

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Merging #2247 (2b0a072) into main (61bda88) will increase coverage by 0.00%.
The diff coverage is 90.00%.

@@           Coverage Diff           @@
##             main    #2247   +/-   ##
=======================================
  Coverage   87.90%   87.91%           
=======================================
  Files         120      120           
  Lines       12417    12424    +7     
=======================================
+ Hits        10915    10922    +7     
  Misses       1502     1502           
Impacted Files Coverage Δ
arviz/plots/backends/matplotlib/distplot.py 92.85% <87.50%> (+0.54%) ⬆️
arviz/plots/backends/bokeh/distplot.py 84.84% <100.00%> (+0.47%) ⬆️

@OriolAbril OriolAbril merged commit 88f7e2a into arviz-devs:main Jun 10, 2023
@OriolAbril OriolAbril deleted the hist branch June 10, 2023 08:23
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.

1 participant