I have a question about display range and color map for clustergram. Display range is different between data sets. I like to keep one color scheme for many datasets.(eg. white color =1 for all the data set in different clustergrams)

1 visualización (últimos 30 días)
I have a question about display range and color map for clustergram. I like to keep one color scheme for many datasets.
First data set: (run this code with same data set)
%all_data=[reshape(ones(1,10),10,1) reshape(rand(1,10),10,1) reshape(5*randn(1,10),10,1) reshape(25*rand(1,10),10,1)] all_data =[ 1.0000 0.4795 -5.7034 4.8007; 1.0000 0.6393 -5.4667 3.4719; 1.0000 0.5447 -2.1680 17.4067; 1.0000 0.6473 -0.8423 2.3455; 1.0000 0.5439 -1.0927 13.1351; 1.0000 0.7210 2.7067 13.2586; 1.0000 0.5225 1.9463 21.5285; 1.0000 0.9937 3.7561 12.1213; 1.0000 0.2187 8.8913 9.8364; 1.0000 0.1058 6.1153 16.7858;]; AJ=clustergram(all_data, 'Cluster',1); %AJ=clustergram(all_data); set(AJ, 'Standardize', 'NONE'); %with SAMPLE set(AJ,'DisplayRange',32); set(AJ, 'Symmetric', 0); zz=[0 0 1;0.150000005960464 0.150000005960464 1;0.300000011920929 0.300000011920929 1;0.449999988079071 0.449999988079071 1;0.600000023841858 0.600000023841858 1;0.75 0.75 1;0.972549021244049 0.972549021244049 0.972549021244049;1 1 1;0.974117636680603 0.898039221763611 0.800000011920929;0.948235273361206 0.796078443527222 0.600000023841858;0.922352969646454 0.694117665290833 0.400000005960464;0.896470606327057 0.592156887054443 0.200000002980232;0.87058824300766 0.490196079015732 0;0.833986937999725 0.470065355300903 0.0125490194186568;0.797385632991791 0.449934631586075 0.0250980388373137;0.760784327983856 0.429803907871246 0.0376470610499382;0.724183022975922 0.40967321395874 0.0501960776746273;0.687581717967987 0.389542490243912 0.062745101749897;0.650980412960052 0.369411766529083 0.0752941220998764;0.614379107952118 0.349281042814255 0.0878431424498558;0.577777802944183 0.329150319099426 0.100392155349255;0.541176497936249 0.30901962518692 0.112941175699234;0.504575192928314 0.288888901472092 0.125490203499794;0.467973858118057 0.268758177757263 0.138039216399193;0.431372553110123 0.248627454042435 0.150588244199753;0.394771248102188 0.228496730327606 0.163137257099152;0.358169943094254 0.208366021513939 0.175686284899712;0.321568638086319 0.18823529779911 0.18823529779911;0.24117648601532 0.141176477074623 0.141176477074623;0.160784319043159 0.0941176488995552 0.0941176488995552;0.0803921595215797 0.0470588244497776 0.0470588244497776;0 0 0]; set(AJ, 'Colormap', zz);
%%%%%%%%%%%%%% Notice color scheme 0/1 is white.
2nd data set:
%all_data=[reshape(ones(1,10),10,1) reshape(rand(1,10),10,1) reshape(5*randn(1,10),10,1) reshape(25*rand(1,10),10,1)] all_data =[ 1.0000 0.4795 -5.7034 4.8007; 1.0000 0.6393 -5.4667 3.4719; 1.0000 0.5447 -2.1680 7.4067; 1.0000 0.6473 -0.8423 2.3455; 1.0000 0.5439 -1.0927 3.1351; 1.0000 0.7210 2.7067 3.2586; 1.0000 0.5225 1.9463 11.5285; 1.0000 0.9937 3.7561 1.1213; 1.0000 0.2187 8.8913 9.8364; 1.0000 0.1058 6.1153 10.7858;];
AJ=clustergram(all_data, 'Cluster',1); %AJ=clustergram(all_data); set(AJ, 'Standardize', 'NONE'); %with SAMPLE set(AJ,'DisplayRange',32); set(AJ, 'Symmetric', 0);
%disp ('Display range used is 32'); %display_range=32; %set(AJ,'DisplayRange',display_range); %
zz=[0 0 1;0.150000005960464 0.150000005960464 1;0.300000011920929 0.300000011920929 1;0.449999988079071 0.449999988079071 1;0.600000023841858 0.600000023841858 1;0.75 0.75 1;0.972549021244049 0.972549021244049 0.972549021244049;1 1 1;0.974117636680603 0.898039221763611 0.800000011920929;0.948235273361206 0.796078443527222 0.600000023841858;0.922352969646454 0.694117665290833 0.400000005960464;0.896470606327057 0.592156887054443 0.200000002980232;0.87058824300766 0.490196079015732 0;0.833986937999725 0.470065355300903 0.0125490194186568;0.797385632991791 0.449934631586075 0.0250980388373137;0.760784327983856 0.429803907871246 0.0376470610499382;0.724183022975922 0.40967321395874 0.0501960776746273;0.687581717967987 0.389542490243912 0.062745101749897;0.650980412960052 0.369411766529083 0.0752941220998764;0.614379107952118 0.349281042814255 0.0878431424498558;0.577777802944183 0.329150319099426 0.100392155349255;0.541176497936249 0.30901962518692 0.112941175699234;0.504575192928314 0.288888901472092 0.125490203499794;0.467973858118057 0.268758177757263 0.138039216399193;0.431372553110123 0.248627454042435 0.150588244199753;0.394771248102188 0.228496730327606 0.163137257099152;0.358169943094254 0.208366021513939 0.175686284899712;0.321568638086319 0.18823529779911 0.18823529779911;0.24117648601532 0.141176477074623 0.141176477074623;0.160784319043159 0.0941176488995552 0.0941176488995552;0.0803921595215797 0.0470588244497776 0.0470588244497776;0 0 0]; set(AJ, 'Colormap', zz);
%%%%%%% Note 0/1 is not white color anymore. How can I keep the same color during different data set clustergram plots?
Thanks.

Respuestas (0)

Categorías

Más información sobre Data Import and Management en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by