我想在刻面图上注释一些文字

时间:2018-05-30 20:09:15

标签: r ggplot2 geom-text

我想使用以下代码在分面图上注释一些文本:

ggplot(All.Leads, aes(Air_Volume, Proximal_Bowing, color = Model)) + 
facet_wrap(facets = ~Model, nrow = 3) + 
geom_point(size = 1.5) + 
geom_smooth(method = lm, se =  FALSE) +
scale_color_manual(values = c("darkgoldenrod1", "grey55", "dodgerblue1")) + 
labs(title = "Influence of Intracranial Air Volume on Maximum Proximal Lead 
Bowing", xlab = "Intracranial Air Volume (mm^3)", ylab = "Maximum Proximal 
Lead Bowing (mm)") +
geom_text(x = 3500, y = 3.5, label = "Medtronic: r = 0.81", color = 
"dodgerblue1") + 
geom_text(x = 3500, y = 4.1, label = "Boston Scientific: r = 0.57", color = 
"grey45") + 
geom_text(x = 3500, y = 4.7, label = "Abbott/SJM: r = 0.44", color = 
"darkgoldenrod1") + 
theme_classic()

我想包括"美敦力:r = 0.81"底面上的geom_text," Boston Scientific:r = 0.57"中间方面的geom_text," Abbott / SJM:r = 0.44"顶面上的geom_text。任何帮助将不胜感激!

请参阅此处的ggplot图片:http://rpubs.com/Gopher16/393175

0 个答案:

没有答案