嗨,当只有几个点时,我的密度图会显示点之间的条纹/凹陷,请参见这张图片:
http://www.imagesup.net/?di=3141413124212
# show fringes
test = as.data.frame( sample(0:5,1000,replace=T) )
colnames(test) = c('mon')
ggplot(test, aes(x=mon)) + geom_density(binwidth=1, size=1)
# normal
test = as.data.frame( sample(0:20,1000,replace=T) )
colnames(test) = c('mon')
ggplot(test, aes(x=mon)) + geom_density(binwidth=1, size=1)
有人知道如何解决吗?