ggplot2:添加用于facet_grid的变量名称

时间:2016-09-16 18:44:02

标签: r plot graph ggplot2 facet

require(ggplot2)
ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(vs+gear ~ cyl+am) 

here

我想在此图表中添加用于facet_grid的4个变量的名称。我想最好的方法是在角落中添加一个指向行或列的小箭头的变量名称。我正在考虑将annotation_customtextGrob用于此目的,但未能在图表上打印任何内容。

1 个答案:

答案 0 :(得分:4)

这样的东西?

labeller = label_bquote("Gear"==.(gear))

你也可以使用如下语法:

CString
相关问题