18  主题

library(tidyverse)
theme_set(theme_bw())
data<-data.frame(x=rep(c('A','B','C'),time=2),y=c('Female','Male'),value=round(runif(6,20,100)))

data
ggplot(data,aes(x,value,fill=y))+
  geom_col()

18.0.1 坐标轴标题-axis.title

ggplot(mtcars,aes(cyl,mpg))+
  labs(x='hjust=0.2,vjust = -3',y='hjust=0.8,vjust = 3')+
  theme(axis.title = element_text(colour = 'red',face='bold'),
        axis.title.x = element_text(hjust=0.2,vjust = -3),
        axis.title.y = element_text(hjust=0.8,vjust = 3)
        )