问题
is there a color scale palette that can give sequential RAG color for a treemap. I tried "RgYlGn" but due to the range being less over 28 unique values, the colors come out as all Green or Yellow. What I want is the least value being red and median being yellow and max being green with a sequential color gradient from red to green
回答1:
The function colorRampPalette might be useful to you.
colorRampPalette(c("red", "yellow", "green"))
来源:https://stackoverflow.com/questions/34517031/red-amber-green-sequential-palette-for-treemap-in-r