# HG changeset patch # User Ben Abbott # Date 1228714529 -3600 # Node ID 03dab4d76975727221450a191ba49ab403148e8a # Parent 221d555a5b9144badb6b9108c0ea96608ed7dc69 legend.m: Correct ording of legend labels. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-11-24 Ben Abbott + + * plot/legend.m: Correct ording of legend labels. + 2008-03-20 Ben Abbott * statistics/base/statistics.m: Calculate median and quantiles in diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -148,11 +148,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) @@ -201,6 +203,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")