I built a figure with several plots. This figure must be exported type .pdf that includes some simple characters: "■", "▲" and "●".
I'm using ggsave (), which seems very simple to follow.
However, when I export it each of the characters are replaced by other things. I already tried cairo_pdf, without success.
My question is: how can I export the pdf that includes the characters. I have read many blogs and questions without success.
This is my command line:
square <- "■"
triangle <- "▲"
circle<- "●"
p3 <- ggdraw(p2) + draw_label("Sources", x = 0.2, y = 0.09, size = 16,fontface = "bold") +
draw_label("Leaf litter", x = 0.3, y = 0.09, size = 16,fontface = "plain") +
draw_label(square, x = 0.27, y = 0.092, size = 30,fontface = "bold", color = "coral4",
fontfamily = "Tahoma") +
draw_label("Biofilm", x = 0.4, y = 0.09, size = 16,fontface = "plain") +
draw_label(triangle, x = 0.37, y = 0.092, size = 30,fontface = "bold", color = "turquoise3",
fontfamily = "Tahoma") +
draw_label("Algae", x = 0.5, y = 0.09, size = 16,fontface = "plain") +
draw_label(circle, x = 0.47, y = 0.092, size = 30,fontface = "bold", color = "greenyellow",
fontfamily = "Tahoma")
p3
p3 + ggsave("Figure_2C.pdf", width=11, height=6.5, dpi = 600)
Here is the figure with the wrong characters.
Thanks in advance.