首先是构造一份数据集
library(ggplot2)
df<-data.frame(x=c(1,1),
y=c(1,2),
label=c(...image.png
文本框的四周默认是带有圆角的,如果不想要圆角可以使用参label.r
ggplot(data=df,aes(x=x,y=y))+
geom_label(aes(label=label...image.png
这样就变成了直角
如果不想要文本框四周的黑线,可以使用label.size=NA参数
ggplot(data=df,aes(x=x,y=y))+
geom_label(aes(label...image.png
调整带颜色的背景的大小,可以使用label.padding参数
ggplot(data=df,aes(x=x,y=y))+
geom_label(aes(label=label,...image.png
学英语时间
padding 字典的解释
1 soft material that is placed inside sth to make it more comfortable or