1
votes

I am generating eps figures in R using the postscript device, something like this (simplified):

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()

Now my question is about the font size I am trying to fiddle with using cex.axis, in a clumsy way. I am supposed to have the axis labels in font size 8. Can I somehow tell the postscript device that I want the base font size = 8? I.e. for cex = 1 I want font size = 8. All I found available is the cex parameter, which is relative to something which I don't know how to even get, let alone set...

PS: I tried ?postscript but haven't found the answer

1
You set the point size when you instantiate the font, either with the scalefont or setfont operator. I have no idea how you would persuade R to produce the output you want, presumably it must be producing PostScript containing one of those operators or everything would be in the default font (Courier usually)KenS
Please try reading ?postscript again.IRTFM
@BondedDust couldn't you just point out the key part?Tomas
The comment by KenS suggested that you seek to modify the "point size". Since there is a pointsize parameter listed in Courier font along the left side of the Arguments list, I thought surely that was enough.IRTFM

1 Answers

2
votes

This produced the expected dimunition in font size on my device.

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

(That image is rotated 90 degrees from how it displays in my pdf-viewer, but I don't think your issue relates to the horizontal argument.)