Changing Fonts for Graphs in R

前端 未结 4 624
感情败类
感情败类 2020-11-28 06:22

In my study I am generating various graphs using R. I see that most of the graphs come up with a Sans Serif type font with various sizes.

How to I change all the te

4条回答
  •  情话喂你
    2020-11-28 07:00

    UPDATE 2020 This can now be solved by using the ggtext package, e.g.:

    install.packages(ggtext)
    
    plot <- plot + theme(
      legend.text = ggtext::element_markdown(family = 'Times', face='bold')
    )
    

    In addition, you can use markdown to complement your plot text. I experienced ggtext simpler and more fail safe than extrafont.

提交回复
热议问题