changeset 24188:1253132e2173

Use "clf;" at beginning of all plot demos. * camlookat.m, camorbit.m, campos.m, camroll.m, camtarget.m, camup.m, camva.m, camzoom.m, grid.m, camlight.m, ezplot.m, isocaps.m, isocolors.m, isonormals.m, isosurface.m, light.m, plot.m, reducepatch.m, smooth3.m, subplot.m: Use "clf;" at beginning of all plot demos.
author Rik <rik@octave.org>
date Mon, 30 Oct 2017 21:22:15 -0700
parents ff9bd559799b
children 7a2cecc1ec24
files scripts/plot/appearance/camlookat.m scripts/plot/appearance/camorbit.m scripts/plot/appearance/campos.m scripts/plot/appearance/camroll.m scripts/plot/appearance/camtarget.m scripts/plot/appearance/camup.m scripts/plot/appearance/camva.m scripts/plot/appearance/camzoom.m scripts/plot/appearance/grid.m scripts/plot/draw/camlight.m scripts/plot/draw/ezplot.m scripts/plot/draw/isocaps.m scripts/plot/draw/isocolors.m scripts/plot/draw/isonormals.m scripts/plot/draw/isosurface.m scripts/plot/draw/light.m scripts/plot/draw/plot.m scripts/plot/draw/reducepatch.m scripts/plot/draw/smooth3.m scripts/plot/util/subplot.m
diffstat 20 files changed, 33 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/camlookat.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camlookat.m	Mon Oct 30 21:22:15 2017 -0700
@@ -150,6 +150,7 @@
 
 
 %!demo
+%! clf;
 %! [x, y, z] = peaks ();
 %! surf (x, y, z/5);
 %! hold on
--- a/scripts/plot/appearance/camorbit.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camorbit.m	Mon Oct 30 21:22:15 2017 -0700
@@ -181,6 +181,7 @@
 
 
 %!demo
+%! clf;
 %! peaks ();
 %! ## rotate the camera upwards
 %! camorbit (0, 30);
--- a/scripts/plot/appearance/campos.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/campos.m	Mon Oct 30 21:22:15 2017 -0700
@@ -106,6 +106,7 @@
 
 
 %!demo
+%! clf;
 %! sphere ();
 %! ## where is camera located?
 %! x1 = campos ()
--- a/scripts/plot/appearance/camroll.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camroll.m	Mon Oct 30 21:22:15 2017 -0700
@@ -92,7 +92,8 @@
 
 
 %!demo
-%! peaks ()
+%! clf;
+%! peaks ();
 %! camroll (30)
 
 %!test
--- a/scripts/plot/appearance/camtarget.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camtarget.m	Mon Oct 30 21:22:15 2017 -0700
@@ -116,6 +116,7 @@
 
 
 %!demo
+%! clf;
 %! sphere ();
 %! ## where is camera pointing?
 %! x1 = camtarget ()
--- a/scripts/plot/appearance/camup.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camup.m	Mon Oct 30 21:22:15 2017 -0700
@@ -111,7 +111,8 @@
 
 
 %!demo
-%! sphere ()
+%! clf;
+%! sphere ();
 %! ## what direction is "up" for the camera?
 %! x1 = camup ()
 %! ## re-orient the camera with a new up-vector
--- a/scripts/plot/appearance/camva.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camva.m	Mon Oct 30 21:22:15 2017 -0700
@@ -98,6 +98,7 @@
 
 
 %!demo
+%! clf;
 %! peaks ();
 %! ## query the viewing angle
 %! a1 = camva ()
--- a/scripts/plot/appearance/camzoom.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/camzoom.m	Mon Oct 30 21:22:15 2017 -0700
@@ -81,6 +81,7 @@
 
 
 %!demo
+%! clf;
 %! peaks ();
 %! camzoom (2);
 
--- a/scripts/plot/appearance/grid.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/appearance/grid.m	Mon Oct 30 21:22:15 2017 -0700
@@ -150,6 +150,7 @@
 %!  title ("yminorgrid on");
 
 %!demo
+%! clf;
 %! subplot (2,2,1);
 %!  semilogy (1:100);
 %!  grid off;
--- a/scripts/plot/draw/camlight.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/camlight.m	Mon Oct 30 21:22:15 2017 -0700
@@ -199,6 +199,7 @@
 
 
 %!demo
+%! clf;
 %! ## Adding lights to a scene
 %! sphere (64);
 %! camlight
@@ -209,6 +210,7 @@
 %! title ({"camlight()", "lights are left and right"});
 
 %!demo
+%! clf;
 %! sphere (48);
 %! title ({"camlight()", "light in fixed position ignores camera change"});
 %! axis equal;
@@ -224,6 +226,7 @@
 %! endfor
 
 %!demo
+%! clf;
 %! sphere (48);
 %! title ({"camlight()", "update light position with camera change"});
 %! axis equal;  shading flat
--- a/scripts/plot/draw/ezplot.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/ezplot.m	Mon Oct 30 21:22:15 2017 -0700
@@ -88,6 +88,7 @@
 
 %!demo
 %! ## sinc function using function handle
+%! clf;
 %! f = @(x) sin (pi*x) ./ (pi*x);
 %! ezplot (f);
 
--- a/scripts/plot/draw/isocaps.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/isocaps.m	Mon Oct 30 21:22:15 2017 -0700
@@ -366,6 +366,7 @@
 
 
 %!demo
+%! clf;
 %! isoval = .4;
 %! lin = linspace (0, 1.2, 15);
 %! [x, y, z] = meshgrid (lin, lin, lin);
@@ -395,6 +396,7 @@
 %! title ({"isocaps()", "sphere with 6 end-caps"});
 
 %!demo
+%! clf;
 %! v = smooth3 (rand (6, 8, 4));
 %! isoval = .5;
 %! x = 1:3:22;  y = -14:5:11;  z = linspace (16, 18, 4);
--- a/scripts/plot/draw/isocolors.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/isocolors.m	Mon Oct 30 21:22:15 2017 -0700
@@ -135,7 +135,7 @@
 %! lin = linspace (0, 2, N);
 %! [x, y, z] = meshgrid (lin, lin, lin);
 %! c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2);
-%! figure (); # Open another figure window
+%! clf;
 %!
 %! subplot (2,2,1);
 %!  view (-38, 20);
--- a/scripts/plot/draw/isonormals.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/isonormals.m	Mon Oct 30 21:22:15 2017 -0700
@@ -131,7 +131,7 @@
 %! lin = linspace (0, 2, N);
 %! [x, y, z] = meshgrid (lin, lin, lin);
 %! val = (x-.5).^2 + (y-.5).^2 + (z-.5).^2;
-%! figure (); # Open another figure window
+%! clf;
 %!
 %! subplot (2,2,1);
 %!  view (-38, 20);
--- a/scripts/plot/draw/isosurface.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/isosurface.m	Mon Oct 30 21:22:15 2017 -0700
@@ -381,6 +381,7 @@
 %! title ("isosurfaces of two nested spheres");
 
 %!demo
+%! clf;
 %! x = 0:2;
 %! y = 0:3;
 %! z = 0:1;
@@ -388,7 +389,6 @@
 %! v        = [0, 0, 0; 0, 0, 0; 0, 0, 1; 0, 0, 1];
 %! v(:,:,2) = [0, 0, 0; 0, 0, 1; 0, 1, 2; 0, 1, 2];
 %! iso = 0.8;
-%! clf;
 %!
 %! ## Three arguments, no output
 %! subplot (2, 2, 1);
--- a/scripts/plot/draw/light.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/light.m	Mon Oct 30 21:22:15 2017 -0700
@@ -374,6 +374,7 @@
 
 %!demo
 %! ## BackFaceLighting
+%! clf;
 %! [x,y,z] = meshgrid (-.5:0.1:2, -2:0.1:2, -2:0.1:2);
 %! val = x.^2 + y.^2 + z.^2;
 %! fv = isosurface (x, y, z, val, 1);
@@ -408,6 +409,7 @@
 %!demo
 %! ## BackFaceLighting 2
 %! ## Matlab fails for "reverselit" with negated isonormals and for "unlit"
+%! clf;
 %! N = 30; iso = .8;
 %! lin = linspace (-1, 1, N);
 %! [x, y, z] = meshgrid (1.2*lin, 1.2*lin, lin);
@@ -416,7 +418,6 @@
 %! fv = isosurface (x, y, z, val, iso);
 %! vn = isonormals (x, y, z, val, fv.vertices);
 %!
-%! clf;
 %! subplot (2, 3, 1);
 %!  view (140, 20);
 %!  axis equal
--- a/scripts/plot/draw/plot.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/plot.m	Mon Oct 30 21:22:15 2017 -0700
@@ -239,16 +239,19 @@
 
 
 %!demo
+%! clf;
 %! x = 1:5;  y = 1:5;
 %! plot (x,y,"g");
 %! title ("plot() of green line at 45 degrees");
 
 %!demo
+%! clf;
 %! x = 1:5;  y = 1:5;
 %! plot (x,y,"g*");
 %! title ("plot() of green stars along a line at 45 degrees");
 
 %!demo
+%! clf;
 %! x1 = 1:5;  y1 = 1:5;
 %! x2 = 5:9; y2 = 5:-1:1;
 %! plot (x1,y1,"bo-", x2,y2,"rs-");
@@ -257,18 +260,21 @@
 %!         "connecting lines drawn"});
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! plot (x, rand (numel (x), 3));
 %! axis ([0 10 0 1]);
 %! title ({"Three random variables", "x[1x11], y[11x3]"});
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! plot (x, rand (3, numel (x)));
 %! axis ([0 10 0 1]);
 %! title ({"Three random variables", "x[1x11], y[3x11]"});
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! plot (repmat (x, 2, 1), rand (2, numel (x)), "-s");
 %! axis ([0 10 0 1]);
@@ -276,12 +282,14 @@
 %!         "x[2x11], y[2,11]"});
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! plot (repmat (x(:), 1, 2), rand (numel (x), 2));
 %! axis ([0 10 0 1]);
 %! title ({"Two random variables", "x[11x2], y[11x2]"});
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! shape = [1, 1, numel(x), 2];
 %! x = reshape (repmat (x(:), 1, 2), shape);
--- a/scripts/plot/draw/reducepatch.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/reducepatch.m	Mon Oct 30 21:22:15 2017 -0700
@@ -350,10 +350,10 @@
 
 
 %!demo
+%! clf;
 %! [x,y,z] = meshgrid (-2:0.5:2, -2:0.5:2, -2:0.5:2);
 %! val = x.^2 + y.^2 + z.^2;
 %! fv = isosurface (x, y, z, val, 1);
-%! figure;
 %! ax1 = subplot (1, 2, 1);
 %! patch (fv, "FaceColor", "g");
 %! view (3);  axis equal;
--- a/scripts/plot/draw/smooth3.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/draw/smooth3.m	Mon Oct 30 21:22:15 2017 -0700
@@ -145,8 +145,8 @@
 
 
 %!demo
+%! clf;
 %! data = rand (10, 10, 10);
-%! clf;
 %! subplot (1, 2, 1);
 %!  patch (isosurface (data, .5), ...
 %!         "FaceColor", "blue", "EdgeColor", "k");
--- a/scripts/plot/util/subplot.m	Tue Oct 24 17:13:51 2017 -0400
+++ b/scripts/plot/util/subplot.m	Mon Oct 30 21:22:15 2017 -0700
@@ -535,6 +535,7 @@
 %! ylabel ylabel;
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! subplot (221);
 %!  plot (x, rand (3, 11));