Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix bad histogramming bins in mri/eeg example. #26352

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

Merged
merged 1 commit into from
Jul 19, 2023
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 19, 2023

The previous version of the histogram showed regular "spikes" which are entirely artefactual; they come from the fact that we were binning (effectively) integer data with floating point bins that did not all cover the same number of ints (even though they have the same floating point width). Using an explicit, integer binsize avoids this issue.

old
old
new
MRI_with_EEG

(I also no longer normalize the histogram to 0-1 as I don't think this adds much, but I can restore that too if it is strongly preferred.)

PR summary

PR checklist

The previous version of the histogram showed regular "spikes" which are
entirely artefactual; they come from the fact that we were binning
(effectively) integer data with floating point bins that did not all
cover the same number of ints (even though they have the same floating
point width).  Using an explicit, integer binsize avoids this issue.
@timhoffm timhoffm merged commit 476b1e6 into matplotlib:main Jul 19, 2023
@timhoffm timhoffm added this to the v3.8.0 milestone Jul 19, 2023
@anntzer anntzer deleted the meh branch July 19, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants