Question

I have data that span several orders of magnitude (-10e-9 to 10e+9). I am displaying them on a value treemap, but I want more control over the colors used.

I assume I would want to use the "manual" treemap type, but I have not had much luck with the palette selection / specification. Is there a way to set up a palette in R with the following characteristics?

  1. Diverging, with negative values going from from red (-10e-9) to green (0) and positive values going from yellow (0) to blue (10e+9).

  2. Logarithmic scaling so that the data points closer to zero don't all get assigned nearly-identical colors.

I tried using natural logs of the data for vColor. This produced the visual effect I wanted, but now my legend is displaying log-transformed values, not the original values.

Was it helpful?

Solution

I think you're on the right track. Unfortunately, "manual" treemap assume linear vColor scales.

I will add an argument to change legend break labels. For the time being, you could modify the labels in the plotted grid object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top