该函数有两个主要参数,binwidth(箱型3宽度)和bins(箱型数量)
该函数两个主要参数bw(箱型的宽度)和kernel(核函数),核函数默认为高斯函数gaussian其他函数包括:epanechnikov,rectangular,triangular,biweight,cosina,optcpsine.
统计直方图是对一个变量的统计,所以aex里面的参数是一个变量,不同于以往的x和y,这里我们对MXSPD进行统计
ggplot(df, aes(x=MXSPD, fill=Location))+
geom_histogram(binwidth = 1,alpha=0.55,colour="black",size=0.25)+
theme(
text=element_text(size=15,color="black"),
plot.title=element_text(size=15,family="myfont",face="bold.italic",hjust=.5,color="black"),#,
legend.position=c(0.8,0.8),
legend.background = element_blank()
)
ggplot(df, aes(x=MXSPD, fill=Location))+
geom_histogram(binwidth = 1,alpha=0.55,colour="black",size=0.25)+ #, aes(fill = ..count..) )
facet_grid(.~Location)+
theme_classic()+
theme(
text=element_text(size=15,color="black"),
plot.title=element_text(size=15,family="myfont",face="bold.italic",hjust=.5,color="black"),#,
legend.position=c(0.8,0.8),
legend.background = element_blank()
)
ggplot(df, aes(x=MXSPD, fill=Location))+
geom_density(alpha=0.55,bw=1,colour="black",size=0.25)+
theme(
text=element_text(size=15,color="black"),
plot.title=element_text(size=15,family="myfont",face="bold.italic",hjust=.5,color="black"),#,
legend.position=c(0.8,0.8),
legend.background = element_blank()
)
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。