[R] Computer Modern

Mr Derik mr418 at cam.ac.uk
Thu Jul 2 11:06:44 CEST 2009


I am trying to use computer modern fonts in postscript files for a latex
document. Ultimately I want to automate this through sweave. I've read the
documentation ans have tried the following code to use lattice to produce a
graph using computer modern:

library(lattice)
library(grid)


testPlot=(
xyplot(seq(1:10) ~ seq(1:10),
                    main="one to ten",
                    xlab="the quick fox",
                    ylab="jumped over the lazy brown dog",
                    xlim=c(0,1),
                    ylim=c(0,1),
                    col="black",
                    type="l" ,
                    lwd=2
                    )
                    )

setwd("C:\\R_folder\\CMtests")
postscript("cm_test.eps", width = 4.0, height = 3.0,
           horizontal = FALSE, onefile = FALSE, paper = "special",
           family = "ComputerModern", encoding = "TeXtext.enc")
           
       print(testPlot)
dev.off() 

This produces a plot with courier.

I am using R 2.9.0 on a windows XP machine. I did manage to produce one plot
with CM as the font so I know it's possible with my set up. I can't get back
to that. Please help me with the code.

Thank You



-- 
View this message in context: http://www.nabble.com/Computer-Modern-tp24303553p24303553.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list