tpemartin / 112-1-programming-for-data-science

MIT License
1 stars 6 forks source link

資料視覺化中文前置 #17

Open tpemartin opened 6 months ago

tpemartin commented 6 months ago
library(ggplot2)
library(showtext)
library(econDV2)
# add google font: Noto Sans TC for chinese characters
sysfonts::font_add_google('Noto Sans TC')
# turn on showing chinese text in graph device
showtext_auto()
# set our graph theme to use the google font and a classic white back ground
theme_set(
  theme(
    text=element_text(family = "Noto Sans TC")
  )+
    theme_classic()
)