Unicode characters in ggplot labels

纵饮孤独 提交于 2020-01-05 04:26:09

问题


I can get ggplot to print Japanese Unicode characters in axis labels and legends, but not in labels. Is this a bug?

library(extrafont)
library(ggplot2)
data_frame <- cbind.data.frame("number"=c(1:3), "kana"=c("い","ろ","は"))
ggplot(data=data_frame, aes(kana, number)) + 
geom_point() + theme_gray(base_family = "Meiryo") ##works great

ggplot(data=data_frame, aes(kana, number, label=kana)) + 
geom_point() + geom_label() + theme_gray(base_family = "Meiryo") ##no such luck

来源:https://stackoverflow.com/questions/43712066/unicode-characters-in-ggplot-labels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!