본문 바로가기
R

(R) geom_histogram/facet_wrap(vars())/facet_grid(vars())/adjust the position of tick mark -scale_y_continuous(breaks=c())

by jangpiano 2020. 9. 1.
반응형


> ggplot(data=airquality,aes(x=Temp))+geom_histogram()


> ggplot(data=airquality,aes(x=Temp))+geom_histogram(binwidth=4,fill="white",colour="black")



<facet_grid(vars()) vs facet_wrap(vars())>


> ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_grid(vars(Month))

 > ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_wrap(vars(Month))

 

 


<The way to adjust the position of tick mark>-  scale_y_continuous(breaks=c())


> ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_grid(vars(Month))

> ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_grid(vars(Month))

+scale_y_continuous(breaks=c(5,10))

 

 


> ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_wrap(vars(Month))

 > ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_wrap(vars(Month))

+scale_y_continuous(breaks=c(5,10))

 

 


<facet_wrap(vars(),scales="free")>

> ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_wrap(vars(Month))

 > ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_wrap(vars(Month),scales="free")

 

 


<facet_grid(vars(),scales="free")>


 > ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_grid(vars(Month))

 > ggplot(data=airquality,aes(x=Temp))

+geom_histogram(binwidth=4,fill="white",colour="black")

+facet_grid(vars(Month),scales="free")

 

 


반응형