if (.Platform$OS.type == "windows"){ windowsFonts(msgothic = windowsFont("MSGothic")) jpfont <- element_text(family = "msgothic") } else if (Sys.info()["sysname"] == "Darwin") { jpfont <- element_text(family = "HiraKakuPro-W3") } else { jpfont <- element_text(family = "IPAexGothic") } d %>% ggplot(aes(x = x, y = y)) + geom_points() + theme( axis.title = jpfont )