ggplot的字体未显示在rmarkdown html

时间:2017-11-09 11:25:04

标签: r ggplot2 fonts knitr r-markdown

我在ggplot中创建了一个带有特定字体的图(参见code family =“Curlz MT”)。但是,当编织为html时,字体默认为原始字体。

FarePlot<-ggplot(data = train,aes(x = Survived,y = Fare))+
      geom_boxplot(fill="#56B4E9")+
      ggtitle("Boxplot of Fare by Survival") +
      ylim(c(0,300))+
      theme(axis.line.x = element_line(size = 0.5, colour = "black"),
          axis.line.y = element_line(size = 0.5, colour = "black"),
          axis.line = element_line(size=1, colour = "black"),
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),
          panel.border = element_blank(),
          panel.background = element_blank(),
          plot.title=element_text(size = 24, family="Curlz MT",face = "bold"),
          text=element_text(size = 18, family="Curlz MT",face="bold"),
          axis.text.x=element_text(colour="black", size = 12,face="bold"),
          axis.text.y=element_text(colour="black", size = 12,face="bold"))

字体显示在R控制台中。但是,当我编织到HTML时,字体会丢失。

如何在编织时显示字体? 感谢

0 个答案:

没有答案