I need to use multiple font families in a single graph and save the output as a pdf.
Kohske’s code (adapted below) is great for a single Japanese font family, but the Japanese font won’t map the Unicode character “ō” and generates the warning
In grid.Call.graphics(L_text, as.graphicsAnnot(x$label), x$x, x$y, :
failed in text conversion to encoding 'EUC-JP’
How do I keep the default font of ggplot (I’m quite pleased with that output) but add a Japanese font family? CairoPDF seems to have parallel problems.
d <- data.frame(x=1:2, y=1:2, t=c("あ","ō"))
a <- ggplot(d, aes(x, y, label=t)) + geom_text() + ggtitle("う")
ggsave("out.pdf", a, family="Japan1GothicBBB”)
Mark Ravina
Prof of History
Emory University
This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.
If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).