2

I would like to write the label on different rows in a treemap (I use another treemap below as an example). I tried to do this with the sep "\n" but this makes the lable hidden behind the treemap if I export as png and if I export as pdf it get pushed of att the top of the document.

Any and all help will be greatly appreciated.

Code example:

library(treemap)
data(GNI2014)
treemap(GNI2014,
        index=c("iso3"),
        vSize="population",
        vColor="GNI",
        type="value",
        title = paste("Population = Number of people living in country",
                      "GNI = Gross National Income",
                      "GNI1111 = Gross National Income 1111",
                      sep="\n"),)

treemap

CaptHaddock
  • 130
  • 1
  • 10

1 Answers1

0

I find the treemap package tough to format, so I convert mine to ggplot. Here's a similar question about how to do that: Converting treemap to ggplot

Note: If you are able to provide a sample data frame when asking questions it helps those of us answering actually try out our responses to make sure they work on your data. Check out: How to make a great R reproducible example?

jesstme
  • 604
  • 2
  • 10
  • 25
  • The data in example is included in R (or the Treemap package) so you should be able to reproduce the treemap above. – CaptHaddock Aug 25 '17 at 13:40