r - 如何在r中更改图例的字体
问题描述
我想将图中标签和轴的字体更改为 Times New Roman 或 Times。 涂鸦博鲁塔
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")
推荐阅读
- c++builder - 通过 Tag 属性查找 TImage
- html - 如何将外部网站的内容嵌入我的网站
- http - Apache Http EntityUtils.consume() 与 EntityUtils.toString()?
- optimization - 使用 google or-tools SAT 求解器舍入 Non-LinearExpr
- javascript - 如何在 tsx 文件中引用 getElementByID 等文档方法?
- python - 如何在循环中使用 Tkinter 中的条目小部件
- django - 在 Django login_required 装饰器中获取用户名
- javascript - 如何在 css classlist.add 中添加一个类来设置我的 javascript 样式
- c++ - 从 Linux-Windows 交叉编译,stdio 有未定义的引用(到 __imp___acrt_iob_func)
- javascript - 如何禁用整个 SharePoint 调查页面上的悬停文本框?