[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: different colours for different curves in the same plot
From: |
marco atzeri |
Subject: |
Re: different colours for different curves in the same plot |
Date: |
Thu, 2 Jun 2011 11:25:00 +0200 |
On Thu, Jun 2, 2011 at 8:38 AM, marco atzeri wrote:
> plot chose different colors (up to 6) if you specify all the data in
> the same plot command
>
> plot(x1_data,y1_data,x2_data,y2_data,x3_data,y3_data)
>
> but she can not use it as the number of curves is not fixed.
>
> but with
>
> hold on
> for i:1:n
> plot(x_data(i),yi_data(j))
> endfor
> hold off
>
> all the curves have the same color, and this is the problem of Federica
>
> Regards
> Marco
>
a simple solution for random color is
hold on
for i=1:n
plot(x_data(i),yi_data(j),"Color",rand(1,3))
endfor
hold off
so all the curves will have random color specified as RGB triple
Marco