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
geom_histogram produces wrong number of bins in special cases #5882
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the following example, only 2 bins were drawn instead of specified 3.
However, by addtionally specifying the center, number of bins is correct.
Without specification of the center, this mistake happens exactly if$min \times(2\times bins + 1) = 3\times max$ , where $min$ and $max$ is the minimum and maximum of the variable, respectively. This equation is equivalent to the situation where shift = 1 in the internal function
bin_breaks_width
.The text was updated successfully, but these errors were encountered: