How to position annotate text in the blank area of facet ggplot

前端 未结 2 1569
轮回少年
轮回少年 2020-12-20 20:50

How to annotate some text in the blank space within a odd numbered faceted ggplot. Lets have a faceted ggplot with data as below with with 2 rows and 2 columns. So there is

相关标签:
2条回答
  • 2020-12-20 21:22

    After you create your plot, simply use

    print(facetplot)
    grid.text("your text", x = 0.75, y = 0.25)
    

    See ?grid.text for details on positioning. The default coordinate system is the entire screen device with (0,0) as the lower left and (1,1) as the upper right.

    0 讨论(0)
  • 2020-12-20 21:27

    To modify the graphical parameter setting for grid.text such as font color, family, fontface and size ...

    grid.text("your text", x = 0.6, y = 0.15, gp = gpar(col="red", fontsize = 20, family = "Times", fontface = "italic"))
    
    0 讨论(0)
提交回复
热议问题