如何更改r中绘图中图例的字体

  • 本文关键字:字体 绘图 何更改 r
  • 更新时间 :
  • 英文 :


我想将绘图中标签和轴的字体更改为Times New Roman或Times。Grafico Boruta

plot(boruta,  family = "Times", cex.lab = 1.0, xaxt = "n", horiz=1, las=1, xlab="Variables", ylab="Importancia")
legend(x = "topleft", legend = c("Importantes",  "Tentativas", "No importantes"), fill = c("green", "yellow",  "red"))

我已经尝试过这个代码,但它显然不会改变字母的字体。有人能告诉我如何将图例字体和绘图轴更改为Times New Roman或Times吗?

谢谢!

在调用legend之前需要设置族。

# Set the font family to "Times" and save defaults in `op`
op <- par(family = "serif")

最新更新