# 【R问题】怎么在ggplot里显示中文。

• Anyway to display the level of variable (district name) in Chinese instead of the UTF-8 code? See example below. Thanks,

• 你好，如果希望在ggplot2中显示中文，需要在画图的时候设定family参数即可：

library(ggplot2)
ggplot(data.frame(x = rnorm(100))) +
geom_histogram(aes(x), fill = ‘purple’, alpha = 0.6) +
labs(x = ‘X 取值’, y = ‘频数 Count’) +
theme(text = element_text(family = ‘SimSun’))

• Thanks for the answer. Sorry I didn’t ask clearly. I was trying to ask how to label the tick value in Chinese, such as "浦东“ instead of “<U+5609…” for x-axis in the plot above. Many thanks,

• Thanks for the answer. Sorry I didn’t ask clearly. I was trying to ask how to label the tick value in Chinese, such as "浦东“ instead of “<U+5609…” for x-axis in the plot above. Many thanks,

hmm 你好，很不好意思的说，这几天在本地测试使用中文显示tick，然而并没有成功
我再试试其他方法，如果成功了马上回复你 =）

====================================

10.10更新：

遍寻无果，R语言可能是不支持用中文坐标轴标注。建议使用代号或者拼音替代进行标注。