cnfont

set chinese font right for ggplot2

install

devtools::install("zengfengbo/cnfont")

usage

library(cnfont)
# for base plot
plot(1:10, xlab = "1到10", ylab = "1到10")

# for ggplot2
library(ggplot2)
ggplot(data.frame(x=1:10, y=1:10*2)) +
  geom_point(aes(x, y)) +
  xlab("X轴") + ylab("Y轴") +
  theme_cn()


zengfengbo/cnfont documentation built on May 15, 2019, 1:42 p.m.