R图中的字体 [英] Fonts in R plots
问题描述
par(family = ...)
选项的少量文档。 理想情况下,我希望能够使用任何字体浏览Linux上的 xfontsel
或其他平台上的等效工具。
我目前的解决方案是绘制为PDF格式,然后使用第三方程序来替换PDF中的字体。这是不理想的。
我今天早上刚刚在这个问题上工作。我发现你可以得到 pdf()
命令可用的字体列表,如下所示:
>名称(pdfFonts())
[1]serifsansmono
[4]AvantGardeBookmanCourier
HelveticaHelvetica - NewCenturySchoolbook
[10]PalatinoTimesURWGothic
...等等...
然后我就这样做了我的生意:
> pdf(file =plot.pdf,family =Palatino,pointsize = 16,width = 16,height = 10)
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=...)
options.
Ideally I'd like to be able to use any font I can browse through a tool like xfontsel
on Linux or the equivalent utilities on other platforms.
My current solution is to plot out as PDF and then use a 3rd party program to replace the fonts from within the PDF. This is not ideal.
I just worked on this issue this morning. I found that you can get a list of fonts 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 ...
So I then went about my business with this:
> pdf(file="plot.pdf",family="Palatino", pointsize=16, width=16,height=10)
这篇关于R图中的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!