changeset 11890:03dab4d76975 release-3-0-x

legend.m: Correct ording of legend labels.
author Ben Abbott <bpabbott@mac.com>
date Mon, 08 Dec 2008 06:35:29 +0100
parents 221d555a5b91
children 177611afa7c1
files scripts/ChangeLog scripts/plot/legend.m
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,7 @@
+2008-11-24  Ben Abbott <bpabbott@mac.com>
+
+	* plot/legend.m: Correct ording of legend labels.
+
 2008-03-20  Ben Abbott <bpabbott@mac.com>
 
 	* statistics/base/statistics.m: Calculate median and quantiles in
--- 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")