How do I resize the treemap output in R
Asked Answered
B

1

7

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

Birch answered 18/2, 2015 at 12:3 Comment(1)
Perfect! Thank you! If you submit it as an answer, I'll mark it as accepted.Birch
S
6

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.

Stemma answered 18/2, 2015 at 12:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.