Basically, I get the plot looking the way I want, with greek letters etc, on the default R plot device, then I switch plot device to create a pdf file and I have 'font' problems.
For example:
> x<- 1:4
> y<-x^2
> plot(x,y)
> text(1,2, "\u03bc") #\u03bc == 'mu'
That all works fine, creating a Greek letter 'mu' on the default R plot device (a graphic window) as desired.
However, when I then switch the plot device to generate a .pdf file:
> pdf()
> plot(x,y)
> text(1,2, "\u03bc")
Gives the following:
Warning messages:
1: In text.default(1, 2, "μ") :
conversion failure on 'μ' in 'mbcsToSbcs': dot substituted for <ce>
2: In text.default(1, 2, "μ") :
conversion failure on 'μ' in 'mbcsToSbcs': dot substituted for <bc>
3: In text.default(1, 2, "μ") :
font metrics unknown for Unicode character U+03bc
4: In text.default(1, 2, "μ") :
conversion failure on 'μ' in 'mbcsToSbcs': dot substituted for <ce>
5: In text.default(1, 2, "μ") :
conversion failure on 'μ' in 'mbcsToSbcs': dot substituted for <bc>
> dev.off()
and the resulting plot in the .pdf file has 'mu' replaced with the two dots '..'
I've done some reading of ?pdf and ?pdfFonts and I suspect I need to load a correct font family in the call to pdf()... Any help along these lines appreciated.
Here's some of my system info:
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)
> search()
[1] ".GlobalEnv" "package:stats" "package:graphics"
[4] "package:grDevices" "package:utils" "package:datasets"
[7] "package:methods" "Autoloads" "package:base"