Modifying fonts in ggplot2

前端 未结 7 1340
再見小時候
再見小時候 2020-11-29 16:43

I am looking for a way to modify font types in ggplot. At the moment I would be happy enough to simply change fonts to the \'courier\' font family, but ultimately my goal is

7条回答
  •  一生所求
    2020-11-29 17:43

    I think your answer is fine but you can do it more simply:

    install.packages("extrafont");library(extrafont)
    font_import("Trebuchet MS")
    library(ggplot2)
    qplot(1:10)+theme(text=element_text(family="Trebuchet MS"))
    

提交回复
热议问题