Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
255 views
in Technique[技术] by (71.8m points)

r - SunburstR: vector of colors

I've been trying to change the colors in my sunburst plot using sunburstR. I df have 3 levels (level 1 to 3 from centre) and the size. I create the plot fine just using the sunburst(df) but I would like for the colors in level 2 and 3 to match the color in level 1 but using different shades.

I've tried defining colors and lebels as suggested here How to specify the colors and toggle labels for each category in R sunburst? but the best I get is:

enter image description here

I actually would like for subsets in level 2 and 3 to have the same level 1 (centre) color but different shades.

I hope you can help me. Thank you very much

question from:https://stackoverflow.com/questions/65846100/sunburstr-vector-of-colors

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It sounds like all you need to do is add the extra two transparency characters for the hex codes.

https://stackoverflow.com/questions/23201134/transparent-argb-hex-value#:~:text=Transparency%20is%20controlled%20by%20the,mixed%20with%20the%20background%20color.

In R, these two extra characters fit on the end of the hex code. For example, #c994c7 is the root color and #c994c780 has 50% transparency.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...