ggplot2中单独增加某条边框的粗细

 

001、

library(ggplot2)
p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point()
p

p+theme(axis.line.x=element_line(linetype=1,color="black",size=0.3))+
  annotate(geom = 'segment', y = Inf, yend = -Inf, color = 'green',
           x = Inf, xend = Inf, size = 6)     ## Inf无穷大, -Inf无穷小

 

posted @ 2023-07-23 10:33  小鲨鱼2018  阅读(156)  评论(0编辑  收藏  举报