6

I'm using Martijn Tennekes's treemap package (version 2.2) in R (version 3.1.2) using RStudio (version 0.98.1091). It's working great but there's one thing I'd like to do - resize the output.

My call looks like this:

treemap(xlFile, 
        index=c("Code1", "Code2"), 
        vSize="size", 
        vColor="ID", 
        type="value", 
        fontsize.labels=c(14,7))

It generates a very small treemap. The aspect ratio is fine (and changing that parameter doesn't change the output dimensions).

I would just like to make the whole treemap output larger. The documentation says the treemap can be zoomed in/out, but I'm not sure that'll help - I want to change the output file, not just the view.

Thank you. John

1
  • Perfect! Thank you! If you submit it as an answer, I'll mark it as accepted.
    – balinjdl
    Feb 18, 2015 at 12:54

1 Answer 1

5

You can set the width and height of your graphical device. You could for example do:

png(filename="tree.png",width=800, height=800)
treemap(xlFile, 
        index=c("Code1", "Code2"), 
        vSize="size", 
        vColor="ID", 
        type="value", 
        fontsize.labels=c(14,7))
dev.off()

You can look at this page if you want the output in another format or if you want to look at more options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.