简单的小例子
library(extrafont)
fonts()
ggplot(df,aes(x=A,y=B,color=D))+
geom_point(aes(shape=D),size=10)...+
theme_bw()+
theme(legend.position = "none")+
annotate(geom = "text",x=3,y=8.5,label="小明的数据分析笔记本...image.png
添加拟合方程的R2的写法
ggplot(df,aes(x=A,y=B,color=D))+
geom_point(size=5)+
annotate("text",x=3,y...=7.5,
label="atop(R^2==0.9^'***')",
parse=T,size=10)+
theme_bw()+
theme(legend.position...image.png
公众号一位读者留言问 自己的数据是经过计算的的只有分位数和中位数的数据,应该如何画箱线图?我自己能想到的一个办法是利用annotate()函数画线段,将其组合成为一个箱子。