Expected histogram behavior? #1160
RobertM314
started this conversation in
General
Replies: 1 comment
-
Hello! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I apologize if I'm posting this in the wrong location.
I'm confused about what's happening when using geom_histogram(aes(y='..density..')
Plot 1 makes sense to me, as does plot 3, but plot 2 seems wrong. For example, the frequency in the first bin is 3, there are a total of 20 data points, the bin width is .2, I would expect the density in the first bin to be:
$\frac{(\frac{3}{20})}{.2} = .75$
Rather than the .84 indicated on the plot.
Is my understanding of the '..density..' aesthetic faulty, and if so, what is it actually doing?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions