Questions tagged «facet-grid»

6
在ggplot2中的各个方面上注释文本
我想用以下代码在绘图的最后一个方面注释一些文本: library(ggplot2) p <- ggplot(mtcars, aes(mpg, wt)) + geom_point() p <- p + facet_grid(. ~ cyl) p <- p + annotate("text", label = "Test", size = 4, x = 15, y = 5) print(p) 但是此代码在每个方面都对文本进行了注释。如果您指导我如何仅在一个方面获得带注释的文本,我将不胜感激。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.