The utf8 character in the label does not appear when I save the plot in pdf format. It does not appear when I use the "Export" button in RStudio, and it does not appear when I include this code in a Sweave document with pdf graphics output. My problem is to get the correct pdf output with Sweave (not knitr).
(If I don't find a solution, I will generate it with tikzDevice
)
ylab <- expression(paste("", bar(italic("\u2113")), "(",phi[0], "|", italic(list(x,y)), ")"))
plot(0,0, ylab=ylab)
EDIT
Follow up question: custom graphical device in sweave shows how to integrate this into a custom graphic device.
This seems to render using
CairoPDF()
frm theCairo
package using ubuntu14.04, R3.2.1.EDIT from Stephane in the comments: ifCairoPDF()
doesn't work, then trycairo_pdf()
.Some sweave code (using Rstudio)
This is the pdf output i get (note the resolution is rubbish as i have converted it to png via gimp)