changeset 11462:aed2c50c3082

legend.m: legend with more than two inline keys (bug 31991). Add/modifyy demos.
author Ben Abbott <bpabbott@mac.com>
date Sat, 08 Jan 2011 10:08:38 -0500
parents 2b8531a6a3c9
children ae96756561d0
files scripts/ChangeLog scripts/plot/legend.m scripts/plot/private/__plt__.m
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sat Jan 08 11:53:51 2011 +0100
+++ b/scripts/ChangeLog	Sat Jan 08 10:08:38 2011 -0500
@@ -1,3 +1,8 @@
+2011-01-08  John Hunt  <huntj@gawab.com>
+
+	* plot/legend.m, plot/private/__plt__.m: legend with more than two
+	inline keys (bug 31991). Add/modifyy demos.
+
 2011-01-07  John W. Eaton  <jwe@octave.org>
 
 	* general/private/__isequal__.m: Compare objects as if they are
--- a/scripts/plot/legend.m	Sat Jan 08 11:53:51 2011 +0100
+++ b/scripts/plot/legend.m	Sat Jan 08 10:08:38 2011 -0500
@@ -989,7 +989,13 @@
 %!demo
 %! clf
 %! x = 0:1;
+%! plot (x, x, ";I am Blue;", x, 2*x, ";I am Green;", x, 3*x, ";I am Red;")
+
+%!demo
+%! clf
+%! x = 0:1;
 %! plot (x, x, ";I am Blue;", x, 2*x, x, 3*x, ";I am Red;")
+%! title ("Blue and Green keys, with Green mising")
 
 %!demo
 %! clf
--- a/scripts/plot/private/__plt__.m	Sat Jan 08 11:53:51 2011 +0100
+++ b/scripts/plot/private/__plt__.m	Sat Jan 08 10:08:38 2011 -0500
@@ -132,7 +132,7 @@
   for i = 1 : n
     key = options.key;
     if (! isempty (key))
-      hlgnd = [hlgnd(:), h(i)];
+      hlgnd = [hlgnd(:); h(i)];
       tlgnd = {tlgnd{:}, key};
     endif
   endfor