help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

legend in multiline plot


From: Bernard Watts
Subject: legend in multiline plot
Date: Fri, 25 Feb 2011 12:11:35 +0100

I'm trying to plot an n:8 matrix ("cadmium.csv") first column versus the 2 to 8 successively, with different colours for each line and a legend, using the script below. At work on an iMac G5 with MacOS 10.5.8 I get the legend and colours fine, allbeit behind the plotted lines. At home on an i3 Intel iMacwith Snow Leopard I get just one item which is the last "specname" with the first line colour, using the same script. Is there something wrong with my coding.
I'm using the Octave 3.2.3 standalone app


species = csvread ("cadmium.csv")
specname = {"lCd"; "lCdOH"; "lCdOH2"; "lCdOH3"; "lCdOH4"; "lCd2OH4"; "lCd4OH4"};
 for i = 2:8
r=i/10
g=1-i/10
b=i/10
(specname(i-1))
plot (species ( :, 1), species( :, i), 'Linewidth', 2, 'Color', [r g b])
legend (specname(i-1))
hold ("on");
endfor



Bernard Watts
reply via email to

[Prev in Thread] Current Thread [Next in Thread]