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

조회 수: 13 (최근 30일)
Natalie Link
Natalie Link 2021년 1월 30일
댓글: Natalie Link 2021년 2월 2일
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.
  댓글 수: 1
Natalie Link
Natalie Link 2021년 2월 2일
Oh this is exactly what I was hoping to do. Thank you so much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Display and Presentation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by