r - 在 GMisc 中选择转换图的字体
问题描述
如何更改使用 R 中的 GMisc 包创建的转换图中的文本字体?
我可以得到 2% 的方法如下:
library(grid)
library(Gmisc)
grid.newpage()
txt <-
"Just a plain box"
windowsFonts(
A=windowsFont("TT Courier New"),
B=windowsFont("TT Helvetica"),
C=windowsFont("TT Montserrat")
)
boxGrob(txt, txt_gp = getOption("boxGrobTxt", default = gpar(fontfamily = "A")))
boxGrob(txt, txt_gp = getOption("boxGrobTxt", default = gpar(fontfamily = "B")))
boxGrob(txt, txt_gp = getOption("boxGrobTxt", default = gpar(fontfamily = "C")))
依次生成三种不同字体的单个框。
我正在寻找一种在渲染像在小插图中创建的过渡图时在全球范围内实现相同目标的方法,即
library(Gmisc)
transitions <- table(data$Charnley_class, data$Charnley_class_1yr) %>%
getRefClass("Transition")$new(label=c("Before surgery", "1 year after"))
transitions$render()
解决方案
推荐阅读
- android-studio - 如何在 android studio 应用程序中添加可以运行 3rd 方软件的模拟器?
- laravel - Laravel Valet 504 Gateway Time-out nginx/1.19.6 after 60 seconds
- flutter - 输入'未来
' 不是类型 '((GetXState ) => 无效)? - swift - Swift 泛型函数类型排序
- python - Groupby 的 Python 最小/最大日期
- javascript - 数组上的 useTransition 返回未定义的数组属性(React Spring)
- spring - 如何为 spring GatewayFilter 测试生成取消的请求?
- excel - 快速/高效的 VBA 代码,用于比较大型数据库(约 9000 行)的 excel 中的两列
- debugging - 我可以阻止 STMCubeIDE 在微控制器复位(调试)时打开启动 .s 文件吗?
- python - 使用 pymssql 连接数据库时遇到问题