Can you change the entire color gradient of a word cloud?
2 views (last 30 days)
Show older comments
Natalie Link
on 30 Jan 2021
Commented: Natalie Link
on 2 Feb 2021
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.)?
0 Comments
Accepted Answer
Shashank Gupta
on 2 Feb 2021
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.
More Answers (0)
See Also
Categories
Find more on Point Cloud Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!