ggplot2: geom_text() with facet_grid()?

前端 未结 2 2126
花落未央
花落未央 2020-12-08 10:57

I just want to add annotation to each panel of figures generated by ggplot2; just simple labels like (a), (b), (c), etc. in each corner. Is there a simple way to do this?

2条回答
  •  眼角桃花
    2020-12-08 11:34

    Basically, you create a data.frame with the text which contains a column with the text, and a column with the variables you use for facet_grid. You can then simply add a geom_text with that data.frame. See the documentation of geom_text for more details on text placement and such.

提交回复
热议问题