Can you change the entire color gradient of a word cloud?

2 次查看(过去 30 天)
Hi!
I made a word cloud but am trying to change the colors to make it stand out.
If I say "wordcloud(x,y,'Color',[<decimal1>,<decimal2>,<decimal3>])" it leaves the big orange words as orange and changes all the rest of them to be the same color of choice. Is there any way to have more variety than this, such that you can manually change the color of different groups of words separately (i.e. all words with 2 occurrences are one color of choice, all with 3 are another, etc.)?

采纳的回答

Shashank Gupta
Shashank Gupta 2021-2-2
Yeah you can specify the colour based on occurence of words while using the function wordcloud. Here is the link for the same. In case I am also adding a small piece of code for you. check this out.
% Load some words.
load sonnetsTable
% Extract a small data so as to visualize it better.
tb = tbl(1:8,:)
% Define colour of each words. These are Normalized RGB values.
cl = [1,1,1;1,0,1;1,1,0;1,0,0;0,1,1;0,0,1;0,1,0;0,0,0]
% plot the wordcloud.
wordcloud(tb,'Word','Count','Color',cl);
I hope this helps you.
Cheers.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by