showtext

Changing fonts in ggplot2

送分小仙女□ 提交于 2019-11-26 03:59:19
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 off of this. In trying to set family="" in ggplot2 theme() I can't seem to generate a change in fonts as I compile the MWE below with different font families. library(ggplot2) library(extrafont) loadfonts(device = "win") a <- ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + ggtitle("Fuel Efficiency of 32 Cars") + xlab("Weight (x1000 lb)") + ylab("Miles per Gallon") + theme(text=element_text(size=16, # family="Comic Sans MS")) # family="CM Roman")) #

Changing fonts in ggplot2

社会主义新天地 提交于 2019-11-26 00:47:25
问题 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 off of this. In trying to set family=\"\" in ggplot2 theme() I can\'t seem to generate a change in fonts as I compile the MWE below with different font families. library(ggplot2) library(extrafont) loadfonts(device = \"win\") a <- ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + ggtitle(\"Fuel Efficiency of 32 Cars\") + xlab(\"Weight (x1000 lb)\")