使用postscript设备的默认字体大小

时间:2015-04-01 07:08:08

标签: r plot postscript

我使用postscript设备在R中生成eps数字,类似这样(简化):

require(extrafont)
#font_import() # I did it only once when installing new fonts
# see http://www.fromthebottomoftheheap.net/2013/09/09/preparing-figures-for-plos-one-with-r/
loadfonts(device = "postscript")
postscript("elev.eps", width = 70/25.4, height = 75/25.4,
           family = "Myriad Web Pro", paper = "special", onefile = FALSE,
           horizontal = FALSE)
barplot(krk$counts, space=0, horiz=T, cex.axis = 0.7)
dev.off()

现在我的问题是关于我试图使用cex.axis以笨拙的方式摆弄的字体大小。我应该有字体大小8的轴标签。我可以以某种方式告诉postscript设备我想要基本字体大小= 8?即for cex = 1我想要字体大小= 8.我发现所有可用的是cex参数,它与某些有关,我不知道如何获取,更不用说设置了...

PS:我尝试了?postscript但未找到答案

1 个答案:

答案 0 :(得分:2)

这会在我的设备上产生预期的字体大小。

postscript("elev.eps", width = 70/25.4, height = 75/25.4,
            paper = "special", onefile = FALSE,
           horizontal = FALSE, pointsize=8)
barplot(1,1, space=0, horiz=T, cex.axis = 0.7)
dev.off()

enter image description here

(该图像与我在pdf查看器中的显示方式相比旋转了90度,但我认为您的问题与水平参数无关。)

相关问题