MATLAB: Can you change the entire color gradient of a word cloud

word cloud

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.)?

Best Answer

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.