I'm trying to create a treemap using R package treemap
. Here is the code (it's a sample from the package)
library(treemap)
data(GNI2010)
treemap(GNI2010,
index=c("continent", "iso3"),
vSize="population",
vColor="GNI",
type="value")
The issue I'm having is with the colour of the labels. When I have just one index, then the output is ok:
library(treemap)
data(GNI2010)
treemap(GNI2010,
index=c("iso3"), #single index
vSize="population",
vColor="GNI",
type="value")
But when I have multiple indexes, then the label changes colour. I just want all labels to be transparent. Is that possible?
Just as I wrote this I found the solution in the documentation:
you just need to add the option bg.lables = 0
. Its a range from 0-255, by default its 220.
library(treemap)
data(GNI2010)
treemap(GNI2010,
index=c("continent", "iso3"),
vSize="population",
vColor="GNI",
type="value",
bg.labels = 0)
There are other options in the package to let you play with colours. But at least the label can be transparent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With