How do I omit labels in the R treemap?

前端 未结 2 926
感情败类
感情败类 2021-01-25 10:41

I\'ve been using the R treemap package and I have a treemap that\'s 2 levels deep. I want the second level labels to be printed but not the first.

Using the example in t

2条回答
  •  [愿得一人]
    2021-01-25 11:27

    To remove the continent labels, you can post hoc edit the graph. The graph produces a grid object. The last two elements of this grid object seem to be the country labels. Hence you can remove them this way:

    lapply(tail(grid.ls(print=FALSE)$name, 2), grid.remove)
    

    enter image description here

提交回复
热议问题