0

包“树图”允许绘制分层树图。

交叉线的粗细不能根据cran 文档定制。我想让它们更厚一点,以真正确保层次结构是可见的。

有什么技巧可以修改线条粗细吗?

4

2 回答 2

1

首先,感谢您使用 treemap 包。

调整线条粗细尚未在树形图中实现,但我将在下一个版本中包含它。

目前的解决方法是:

library(treemap)
data(GNI2010)
treemap(GNI2010,
         index=c("continent", "iso3"),
         vSize="population",
         vColor="GNI",
         type="value")

library(grid)
getNames() #get all grid object names
grid.edit("Africa", gp=gpar(lwd=4))

更新 它已经包含在开发中。https://github.com/mtennekes/treemap上的版本。请参阅参数 lwds。

于 2013-07-26T07:32:28.763 回答
1

获取treemap的开发版本(目前为2.1版本):

library(devtools)
install_github("treemap", username="mtennekes", subdir="pkg")
library(treemap)

接下来使用border.lwds(不是lwds)定义线宽。

data(business) # in treemap
treemap(business,
    index=c(paste0("NACE",1:3)),
    vSize="employees",
    vColor="NACE1",
    type="categorical",
    border.col = c("red","white"), # defines line colour 
    border.lwds = c(1,3), # defines line width
    position.legend = "none") # remove legend
于 2013-11-05T09:46:03.903 回答