I was wondering how does stat_summary_bin function bin when we use bin
argument?
ggplot(df, aes(x=x,y=y)) +
stat_summary_bin(fun='mean', bins=100,
color='orange', size=2, geom='point') + geom_smooth(method='lm') + theme_minimal()
Does it split the x-axis
into equal width? Or Does each bin have an equal number of observations?
I thought stat_summary_bin
splits the x axis into equally spaced bins. But the following plot it the result of the above code, and it doesn't seem like it's spaced equally on the x axis.