changeset 21155:8b1e030d3d4f stable

doc: Correct example errobar code and plot (bug #46972). * plot.txi: Correct example code in manual. * plotimages.m: Use correct code from manual to generate errorbar plot.
author Rik <rik@octave.org>
date Sat, 30 Jan 2016 07:55:18 -0800
parents 6f6eae08836f
children 80b69efcd960 2935d56203a4
files doc/interpreter/plot.txi doc/interpreter/plotimages.m
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/plot.txi	Wed Jan 27 12:47:22 2016 +0100
+++ b/doc/interpreter/plot.txi	Sat Jan 30 07:55:18 2016 -0800
@@ -177,9 +177,9 @@
 @group
 x = 0:0.1:10;
 y = sin (x);
-yp =  0.1 .* randn (size (x));
-ym = -0.1 .* randn (size (x));
-errorbar (x, sin (x), ym, yp);
+lerr = 0.1 .* rand (size (x));
+uerr = 0.1 .* rand (size (x));
+errorbar (x, y, lerr, uerr);
 @end group
 @end example
 
--- a/doc/interpreter/plotimages.m	Wed Jan 27 12:47:22 2016 +0100
+++ b/doc/interpreter/plotimages.m	Sat Jan 30 07:55:18 2016 -0800
@@ -49,9 +49,9 @@
     rand ("state", 2);
     x = 0:0.1:10;
     y = sin (x);
-    yl = 0.1 .* rand (size (x));
-    yu = 0.1 .* rand (size (x));
-    errorbar (x, sin (x), yl, yu);
+    lerr = 0.1 .* rand (size (x));
+    uerr = 0.1 .* rand (size (x));
+    errorbar (x, y, lerr, uerr);
     axis ([0, 10, -1.1, 1.1]);
     xlabel ("x");
     ylabel ("sin (x)");