# HG changeset patch # User Rob Mahurin # Date 1235548047 -3600 # Node ID 0d7e145c1ca4b07c7c9d974ae59762acc37a10bd # Parent a24565131108d8ec670d656799c4d103690e938d fix order of legends diff -r a24565131108 -r 0d7e145c1ca4 scripts/ChangeLog --- a/scripts/ChangeLog Wed Feb 25 08:40:31 2009 +0100 +++ b/scripts/ChangeLog Wed Feb 25 08:47:27 2009 +0100 @@ -1,3 +1,8 @@ +2009-02-24 Rob Mahurin + + * plot/legend.m: Fix legend order. Add explicit colors to demos. + From Marco Caliari + 2009-02-23 John W. Eaton * plot/fplot.m: Fix nargin check. diff -r a24565131108 -r 0d7e145c1ca4 scripts/plot/legend.m --- a/scripts/plot/legend.m Wed Feb 25 08:40:31 2009 +0100 +++ b/scripts/plot/legend.m Wed Feb 25 08:47:27 2009 +0100 @@ -171,7 +171,7 @@ endif warned = false; - for i = nargs:-1:1 + for i = 1:nargs arg = varargin{i}; if (ischar (arg)) while (k <= nkids @@ -201,7 +201,7 @@ %!demo %! close all; -%! plot(1:10, 1:10, 1:10, fliplr(1:10)); +%! plot(1:10, 1:10, 'b', 1:10, fliplr(1:10), 'g'); %! title("incline is blue and decline is green"); %! legend({"I'm blue", "I'm green"}, "location", "east") @@ -214,8 +214,9 @@ %!demo %! close all; %! labels = {}; +%! color = 'bgryk'; %! for i = 1:5 -%! plot(1:100, i + rand(100,1)); hold on; +%! plot(1:100, i + rand(100,1), color(i)); hold on; %! labels = {labels{:}, strcat("Signal ", num2str(i))}; %! endfor; hold off; %! title("Signals with random offset and uniform noise")