Fonts in R plots

前端 未结 2 578
春和景丽
春和景丽 2020-12-08 07:03

What graphics devices let me use system fonts for text within charts? The base graphics system only has a small amount of documentation around the par(family=...)

2条回答
  •  春和景丽
    2020-12-08 07:59

    A list of fonts is available to the pdf() command, like this:

    > names(pdfFonts())
     [1] "serif"                "sans"                 "mono"                
     [4] "AvantGarde"           "Bookman"              "Courier"             
     [7] "Helvetica"            "Helvetica-Narrow"     "NewCenturySchoolbook"
    [10] "Palatino"             "Times"                "URWGothic"           
    ... etc ...
    

    To use when creating a PDF, for example:

    > pdf(file="plot.pdf",family="Palatino", pointsize=16, width=16,height=10)
    

提交回复
热议问题