changeset 12387:5fb6ea1bff65

legend.m: Add demo for replacing existing legend.
author Ben Abbott <bpabbott@mac.com>
date Sun, 06 Feb 2011 09:16:03 -0500
parents ca1190196d26
children cf9ca0dbc5ee
files scripts/ChangeLog scripts/plot/legend.m
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sun Feb 06 05:50:49 2011 -0500
+++ b/scripts/ChangeLog	Sun Feb 06 09:16:03 2011 -0500
@@ -1,3 +1,7 @@
+2011-02-06  Ben Abbott  <bpabbott@mac.com>
+
+	* plot/legend.m: Add demo for replacing existing legend.
+
 2011-02-06  John W. Eaton  <jwe@octave.org>
 
 	* general/circshift.m: New tests.
--- a/scripts/plot/legend.m	Sun Feb 06 05:50:49 2011 -0500
+++ b/scripts/plot/legend.m	Sun Feb 06 09:16:03 2011 -0500
@@ -1079,3 +1079,13 @@
 %! plot (x, cos(x), ";cos(x);")
 %! hold off
 
+%!demo
+%! clf
+%! x = 0:0.1:10;
+%! plot (x, sin(x), ";sin(x);")
+%! hold all
+%! plot (x, cos(x), ";cos(x);")
+%! hold off
+%! legend ({"sin(x)", "cos(x)"}, "location", "northeastoutside")
+
+