#总结
if(FALSE){
标度scale
scale_color_manual(vavalues = c())
scale_size_continuous(range = c())
scale_fill_continuous(high='red2',low='blue4')
scale_fill_manual()
几何对象Geom
geom_point()
geom_line()
geom='line'
系统变换stat
stat_density(geom = 'line',position = 'identity',size=1.5,aes(color=factor(year)))
坐标coord
coord_cartesian(xlim=c(),ylim = c())
guides(size=guide_legend(title = ''),colour=guide_legend(title = ''))
#增加扰动
geom_jitter()
#增加透明度
alpha
#二维直方图
stat_bin2d()
#密度图
stat_density2d()
}
ggplot(data = mpg,aes(x=cty,y=hwy,colour=factor(year)))+geom_point()+geom_smooth()
ggplot(data = mpg,aes(x=cty,y=hwy))+geom_point(aes(colour=factor(year)))+geom_smooth()
ggplot(data = mpg,aes(x=cty,y=hwy))+geom_point(aes(colour=factor(year)))+geom_smooth()+scale_color_manual(
values = c('blue','red')
)
#scale_color_manual(values = c('blue','red')
ggplot(data = mpg,aes(x=cty,y=hwy))+geom_point(aes(colour=factor(year),size=displ)
关于ggplot的使用,之后注释
最新推荐文章于 2025-06-09 07:00:00 发布