if (FALSE) {
pdf("test1.pdf")
plot(1, main = "\u6b22\u8fce") ## may not render properly
dev.off()
## Automatically use showtext for future devices
showtext_auto()
plot(1, main = "\u6b22\u8fce", family = "wqy-microhei")
pdf("test2.pdf")
plot(1, main = "\u6b22\u8fce", family = "wqy-microhei")
dev.off()
## Turn off if needed
showtext_auto(FALSE)
}
Run the code above in your browser using DataLab