Add a footnote citation outside of plot area in R?

后端 未结 3 1889
终归单人心
终归单人心 2021-01-30 17:10

I\'d like to add a footnote citation to my 3-panel facet grid plot produced in R. It\'s a footnote to credit the data source. I\'d ideally like to have it below and external t

3条回答
  •  既然无缘
    2021-01-30 17:50

    ggplot2 now has this ability natively with no need for additional packages. ... + labs(caption = "footnote", ...)

    library(ggplot2) 
    ggplot(diamonds, aes(carat, price, color = clarity)) + 
      geom_point() + 
      labs(title = "Diamonds are forever...", 
           subtitle = "Carat weight by Price", 
           caption = "H. Wickham. ggplot2: Elegant Graphics for Data Analysis Springer-Verlag New York, 2009.")
    

提交回复
热议问题