aa <- p + annotate("rect", xmin =2.5, xmax =7.5,## 增加矩形,调整颜色, 调整透明度fill="red", col ="red",ymin =5, ymax =10, alpha = .4) aa 009、增加线段 an6 <- p + annotate("segment", x =2.5, xend =7.5, y =2.5, yend =5, colour="blue")## 增加线段an6 010、调...
001、基础绘图 library(ggplot2) p<- ggplot(faithful, aes(x = eruptions, y = waiting)) +geom_point()## 基础绘图p 002、增加文本 p + annotate("text", x =3, y =48, label ="Group 1") +annotate("text", x =4.5, y =66, label ="Group 2")## 增加文本 003、 ## 设置颜色、字体...
001、基础绘图 ggplot(data=mtcars, aes(x=mpg, y=disp, color=factor(cyl))) + geom_point()## 基础绘图 002、annotete在任意位置增加注释 ggplot(data=mtcars, aes(x=mpg, y=disp,## 在坐标, 25, 300处增加QQcolor=factor(cyl))) + geom_point() +annotate("text", label ="QQQ", x =25, ...