1

Here is a minimal example of the problem I face:

data.frame(Time=as.factor(c(0,5,10,15,20,25,30,35)),
               Value=c(0,2,4,6,8,6,5,6))%>%
  ggplot(aes(x=Time,y=Value))+
  geom_point()+
  ylab("\U0394 O.D")
ggsave("image.pdf", dpi = 1200)

I am able to generate a plot which renders the delta perfectly. However, the last command to save the plot as a PDF gives warnings. When you open the saved file, the y-axis is labelled as ..OD.

Ginko-Mitten
  • 304
  • 1
  • 11

2 Answers2

7

Try to use Cairo:

ggsave("image.pdf", dpi = 1200, device = cairo_pdf)
user12728748
  • 8,106
  • 2
  • 9
  • 14
0

I'm probably too late for this discussion but I had better experience with latex2exp library. I had some issues saving multiple plots with ggsave and cowplot::save_plot I had to look for other solutions. With this method you can use any saving method, your file plot look fine.

Let's say you want to put pi as a label on your y axis.

p <- p + ylab(TeX("$\\pi$"))
evolozzy
  • 13
  • 6