MATLAB Answers

Question about Clustergram colors

2 views (last 30 days)
Noushin Farnoud
Noushin Farnoud on 14 Jul 2014
Answered: yi li on 29 Sep 2018
Dear Matlab Users,
I have a problem understanding which part of clustergram function I need to modify to adapt it to my input data. I have two columns of data ranging from 0-100 (percentage values) in two conditions, and I would like to apply clustergram to visualize how the variables correlate in these two conditions. So some variables (rows) will have low percentage in both conditions, some high in one condition and low in the other one and so on. When I apply basic clustergram function, I receive the following graph.
s= clustergram(vars(:,1:2),'ColumnPdist', 'correlation');
Based on the nature of my data I don't have any negative values (no green), and many values more than the default 'DisplayRange' of 3. Therefore I am limited to what appears to be solid red and black.
Could you please help me understand which parameters of the clustergram function I need to change in order to get instead of this a gradient of green and red colors for my data?
Thank You in advance,
Noushin

  0 Comments

Sign in to comment.

Answers (1)

yi li
yi li on 29 Sep 2018
Maybe you can adjust your original data before you using clustergram. That is mean you can do data translation. You can get the middle value of your data, then let original data to minus this value. At last, you can use this new data to clustergram and you will get what you wanted.

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!