ggplot2: Creating themed title, subtitle with cowplot

后端 未结 2 1212
梦谈多话
梦谈多话 2021-01-13 04:14

I have a list of data frames that I use to make a list of ggplots, and then assemble into a grid of plots with cowplot. I need to then attach a sha

2条回答
  •  一生所求
    2021-01-13 05:05

    Like so?

    library(ggplot2)
    library(cowplot)
    
    theme_georgia <- function(...) {
      theme_gray(base_family = "Georgia", ...) + 
        theme(plot.title = element_text(face = "bold"))
    }
    
    
    title_theme <- calc_element("plot.title", theme_georgia())
    
    ggdraw() + 
      draw_label(
        "Socio-economic measures",
        fontfamily = title_theme$family,
        fontface = title_theme$face,
        size = title_theme$size
      )
    

    Created on 2018-06-21 by the reprex package (v0.2.0).

提交回复
热议问题