我在 grid.arrange 中找不到如何調整標簽到表格的距離:
distances_lsit = c(25,50,75,100)
category_lsit = 0:5
damage_table = matrix(NA, nrow=length(distances_lsit), ncol=length(category_lsit))
damage_table[1,] = c(10,25,50,75,100,100)
damage_table[2,] = c(5,10,25,50,75,100)
damage_table[3,] = c(2.5,5,10,25,50,75)
damage_table[4,] = c(0,2.5,5,10,25,50)
rownames(damage_table) = distances_lsit
colnames(damage_table) = category_lsit
table_scale = tableGrob(damage_table)
grid.arrange(table_scale, top = "Label 1", left = "Label 2")
它產生如下表:

有沒有辦法把它粘在桌子上?預先感謝您的幫助。
uj5u.com熱心網友回復:
您應該使用下一個引數來找到您的最佳位置
- 高度;
- 寬度;
- 文本格羅布。
例如,這個:
grid.arrange(table_scale, top = textGrob("Really looks \n better now?", x = 0, hjust = -1), left = "I'm near,\n my man", heights = c(2,1), widths = c(1,1.5))
向你展示這個:

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/335785.html
