I have a N*K matrix A and I want to get the cdf plot in one graph and change each colors. My code is below but I always get blue color for all.... Since I have more than 10 cdfs to plot it would be great if someone could help me with this in a loop method!!
THanks,
figure
ColorSet = varycolor(K);
set(gcf, 'Colormap', ColorSet );
k=[1:1:K];
for i=1:K
h(i)=cdfplot( betas(i,:) );
hold on
end
"Skirt Zhang" <silenc...@hotmail.com> wrote in message
news:is82o1$qqc$1...@newscl01ah.mathworks.com...
> Dear All,
>
> I have a N*K matrix A and I want to get the cdf plot in one graph and
> change each colors. My code is below but I always get blue color for
> all.... Since I have more than 10 cdfs to plot it would be great if
> someone could help me with this in a loop method!!
Try "hold all" instead of "hold on".
http://www.mathworks.com/help/techdoc/ref/hold.html
--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Use SET function to change color of each line:
clr = jet(10);
hold on
for k = 1:10
y = evrnd(0,k,100,1);
h(k) = cdfplot(y);
set(h(k),'Color',clr(k,:))
end
best regards
Grzegorz