[R] Greek letters in CairoPDF

Eduardo de Oliveira Horta eduardo.oliveirahorta at gmail.com
Wed Jan 26 17:17:57 CET 2011


Hello there,

Straight to the point: it seems that CairoPDF from package "Cairo"
cannot handle greek letters from expression(). For example,

> eta = seq(from=-pi, to=pi, length=100)
> f = sin(eta)^2
> pdf(file = "temp_pdf.pdf")
> plot(eta, f, type="l", main=expression(f(eta)==sin(eta)^2), xlab=expression(eta), ylab=expression(f(eta)))
> dev.off()

gives the expected result, but

> require("Cairo")
> CairoPDF(file = "temp_CairoPDF.pdf")
> plot(eta, f, type="l", main=expression(f(eta)==sin(eta)^2), xlab=expression(eta), ylab=expression(f(eta)))
> dev.off()

leaves a blank where it should display the etas. Any ideas here?
(session info below)

Thanks in advance and best regards,

Eduardo

----

> sessionInfo()
R version 2.11.1 (2010-05-31)
i386-pc-mingw32

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] Cairo_1.4-5



More information about the R-help mailing list