Mercurial > hg > octave-lyh
diff scripts/plot/legend.m @ 8343:9f34f7636fe0
legend.m: Correct ording of legend labels.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 24 Nov 2008 12:27:03 -0500 |
parents | 53f35799b235 |
children | 774b44619c5c |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -165,11 +165,13 @@ nargs = numel (varargin); endif elseif (iscellstr (arg)) - varargin = arg; + varargin = fliplr (arg); nargs = numel (varargin); else error ("legend: expecting argument to be a character string"); endif + else + varargin(1:nargs) = fliplr (varargin(1:nargs)); endif if (nargs > 0) @@ -231,6 +233,12 @@ %!demo %! close all; +%! plot(1:10, 1:10, 1:10, fliplr(1:10)); +%! title("incline is blue and decline is green"); +%! legend({"I'm blue", "I'm green"}, "location", "east") + +%!demo +%! close all; %! plot(1:10, 1:10); %! title("a very long label can sometimes cause problems"); %! legend({"hello world"}, "location", "northeastoutside")