Changing fonts in ggplot2

前端 未结 5 1409
盖世英雄少女心
盖世英雄少女心 2020-11-22 12:59

Once upon a time, I changed my ggplot2 font using using windowsFonts(Times=windowsFont(\"TT Times New Roman\")) to change it. Now I can\'t get it

5条回答
  •  梦谈多话
    2020-11-22 13:35

    A simple answer if you don't want to install anything new

    To change all the fonts in your plot plot + theme(text=element_text(family="mono")) Where mono is your chosen font.

    List of default font options:

    • mono
    • sans
    • serif
    • Courier
    • Helvetica
    • Times
    • AvantGarde
    • Bookman
    • Helvetica-Narrow
    • NewCenturySchoolbook
    • Palatino
    • URWGothic
    • URWBookman
    • NimbusMon
    • URWHelvetica
    • NimbusSan
    • NimbusSanCond
    • CenturySch
    • URWPalladio
    • URWTimes
    • NimbusRom

    R doesn't have great font coverage and, as Mike Wise points out, R uses different names for common fonts.

    This page goes through the default fonts in detail.

提交回复
热议问题