我试图从 geom_smooth 中删除回归线,只保留置信区间。我试过 size = 0
, size = NULL
, 和 size = NA
,但没有工作。是否有任何人都知道的简单解决方法?
baseball <- ddply(x, .(id), transform, bat.avg = h/ab)
hank <- subset(baseball, id == 'aaronha01')
ggplot(hank, aes(x = year, y = bat.avg)) +
geom_line(size = 1.2, color = '#336699') +
geom_smooth(fill = '#bf3030', size = NA) +
labs(x = '', y = '')
最佳答案
您可以设置 linetype=0
内geom_smooth()
删除线。
ggplot(mtcars,aes(wt,mpg))+geom_smooth(linetype=0)
关于从 ggplot2 中的 geom_smooth 中删除线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16134425/