Binning inconsistent between stat_bin and stat_bin2d() #178

Closed
jrauser opened this Issue May 10, 2011 · 2 comments

Projects

None yet

2 participants

jrauser commented May 10, 2011
df<-data.frame(hour=rep(0:2,100),value=rnorm(3*100))

# Three bins
ggplot(df,aes(hour))+stat_bin(binwidth=1)

# Only two bins on the x-axis
ggplot(df,aes(hour,value))+stat_bin2d(binwidth=c(1,1))

I suspect this is due to the fact that stat_bin2d() doesn't pass pad=TRUE to fullseq() when determining breaks

https://github.com/hadley/ggplot2/blob/master/R/stat-bin2d.r#L40

but stat_bin() does

https://github.com/hadley/ggplot2/blob/master/R/stat-bin.r#L23

Owner
hadley commented Dec 2, 2011

Putting this of for 1.0 and densityVis integration.

Owner
hadley commented Feb 24, 2014

This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette.

@hadley hadley closed this Feb 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment