[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [newbie] Setting different legends for each plot
From: |
Ben Abbott |
Subject: |
Re: [newbie] Setting different legends for each plot |
Date: |
Mon, 25 Nov 2013 11:40:49 -0500 |
On Nov 25, 2013, at 11:09 AM, Jean Dubois wrote:
> I try to get a different legend for each value of the for-loop-variable acl0
> something like ACL1, ACL2, ACL3, ...
> As it is now, the same legend is plotted for each run...can anyone here help
> me with this?
>
>
> clear
> beta=[0.1:0.1:10];
> for acl0=1:10
> arrayname=sprintf('deltaprocacl_%d',acl0)
> arrayname=100*beta./(1+beta+acl0);
> plot(beta,arrayname,";acl0;")
> hold on
> xlabel 'beta'
> ylabel 'procerror'
> grid on
> endfor
>
> p.s. different colors or graph-types for each run would also be great
>
> thanks in advance
> jean
Does this do what you want?
clear
xlabel 'beta'
ylabel 'procerror'
grid on
hold all
beta=[0.1:0.1:10];
for acl0=1:10
arrayname=sprintf('deltaprocacl_%d',acl0)
arrayname=100*beta./(1+beta+acl0);
plot(beta,arrayname, sprintf (";acl0=%d;", acl0))
endfor
Ben