ggplot如何移动刻度线的位置,比如我想调整纵坐标刻度线和y轴的距离?
代码如下:
library(ggplot2)
ggplot(data=Salaries, aes(x=rank,fill=sex))+geom_bar(position="dodge")+
theme(panel.grid=element_blank(),panel.background=element_blank())+
scale_y_continuous(expand = c(0,0),breaks = seq(0,270,90))+
annotate("segment",x=c(0.3,0.3),xend = c(0.3,2.6),y=c(0,0),yend = c(270,0))+
annotate("segment",x=c(0.25),xend = c(0.35),y=c(45),yend = c(45))