Changing Fonts for Graphs in R

前端 未结 4 599
感情败类
感情败类 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 06:53

    You can change the font in Windows to Times New Roman using the windowsFonts() command and the family option in plot:

    x = seq(1,10,1)
    y = 1.5*x
    windowsFonts(A = windowsFont("Times New Roman"))
    plot(x, y,
      family="A",
      main = "title",
      font=2)
    

    Bold text comes from font=2. As for the size, see ?cex(). Also, see here: http://www.statmethods.net/advgraphs/parameters.html

    enter image description here

提交回复
热议问题