# HG changeset patch # User Ben Abbott # Date 1324520388 18000 # Node ID 22c50cbad2ce92381056b9d99b4115da93da761a # Parent c3ea07298af4f8c61bf6326ac3502d2616cec5f3 Add clf() to all plot demos. * axis.m, compass.m, contour3.m, contourf.m, cylinder.m, ellipsoid.m, errorbar.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezplot.m, ezplot3.m, ezpolar.m, ezsurf.m, ezsurfc.m, feather.m, fplot.m, loglogerr.m, pcolor.m, pie.m, pie3.m, plot3.m, plotmatrix.m, quiver.m, quiver3.m, refreshdata.m, ribbon.m, rose.m, scatter3.m, semilogx.m, semilogxerr.m, semilogy.m, semilogyerr.m, shading.m, sombrero.m, stairs.m, stem.m, stem3.m, surf.m, surfc.m, surfl.m, surfnorm.m, trimesh.m, triplot.m, trisurf.m, uimenu.m: Add clf() to the beginning of each demo to ensure pre-existing graphics objects don't interfere with the demo. diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/axis.m --- a/scripts/plot/axis.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/axis.m Wed Dec 21 21:19:48 2011 -0500 @@ -506,6 +506,7 @@ %! axis tight %!demo +%! clf %! x = -10:0.1:10; %! y = sin(x)./(1+abs(x)) + x*0.1 - .4; %! plot (x, y) @@ -515,6 +516,7 @@ %! box off %!demo +%! clf %! x = -10:0.1:10; %! y = sin(x)./(1+abs(x)) + x*0.1 - .4; %! plot (x, y) @@ -524,6 +526,7 @@ %! box off %!demo +%! clf %! x = -10:0.1:10; %! y = sin(x)./(1+abs(x)) + x*0.1 - .4; %! plot (x, y) @@ -533,6 +536,7 @@ %! box off %!demo +%! clf %! x = -10:0.1:10; %! y = sin(x)./(1+abs(x)) + x*0.1 - .4; %! plot (x, y) @@ -542,6 +546,7 @@ %! box off %!demo +%! clf %! x = -10:0.1:10; %! y = sin(x)./(1+abs(x)) + x*0.1 - .4; %! plot (x, y) diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/compass.m --- a/scripts/plot/compass.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/compass.m Wed Dec 21 21:19:48 2011 -0500 @@ -112,6 +112,7 @@ %!demo +%! clf %! randn_9x1_data = [-2.555884; 0.394974; -0.191871; -1.147024; 1.355425; -0.437335; -0.014370; -0.941312; 1.240300]; %! randn_1x9_data = [1.42934, -1.10821, -1.70404, 0.63357, -0.68337, -1.19771, -0.96502, -1.12810, 0.22457]; %! a = toeplitz ([1;randn_9x1_data], [1,randn_1x9_data]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/contour3.m --- a/scripts/plot/contour3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/contour3.m Wed Dec 21 21:19:48 2011 -0500 @@ -75,6 +75,7 @@ endfunction %!demo +%! clf %! contour3 (peaks (19)); %! hold on %! surface (peaks (19), "facecolor", "none", "edgecolor", "black") diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/contourf.m --- a/scripts/plot/contourf.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/contourf.m Wed Dec 21 21:19:48 2011 -0500 @@ -81,10 +81,12 @@ endfunction %!demo +%! clf %! [x, y, z] = peaks (50); %! contourf (x, y, z, -7:9) %!demo +%! clf %! [theta, r] = meshgrid (linspace (0, 2*pi, 64), linspace(0,1,64)); %! [X, Y] = pol2cart (theta, r); %! Z = sin(2*theta).*(1-r); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/cylinder.m --- a/scripts/plot/cylinder.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/cylinder.m Wed Dec 21 21:19:48 2011 -0500 @@ -86,6 +86,7 @@ endfunction %!demo +%! clf %! [x, y, z] = cylinder (10:-1:0,50); %! surf (x, y, z); %! title ("a cone") diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ellipsoid.m --- a/scripts/plot/ellipsoid.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ellipsoid.m Wed Dec 21 21:19:48 2011 -0500 @@ -70,4 +70,5 @@ endfunction %!demo +%! clf %! ellipsoid (0, 0, 1, 2, 3, 4, 20); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/errorbar.m --- a/scripts/plot/errorbar.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/errorbar.m Wed Dec 21 21:19:48 2011 -0500 @@ -138,16 +138,19 @@ %!demo +%! clf %! rand_1x11_data1 = [0.82712, 0.50325, 0.35613, 0.77089, 0.20474, 0.69160, 0.30858, 0.88225, 0.35187, 0.14168, 0.54270]; %! rand_1x11_data2 = [0.506375, 0.330106, 0.017982, 0.859270, 0.140641, 0.327839, 0.275886, 0.162453, 0.807592, 0.318509, 0.921112]; %! errorbar (0:10, rand_1x11_data1, 0.25*rand_1x11_data2); %!demo +%! clf %! rand_1x11_data3 = [0.423650, 0.142331, 0.213195, 0.129301, 0.975891, 0.012872, 0.635327, 0.338829, 0.764997, 0.401798, 0.551850]; %! rand_1x11_data4 = [0.682566, 0.456342, 0.132390, 0.341292, 0.108633, 0.601553, 0.040455, 0.146665, 0.309187, 0.586291, 0.540149]; %! errorbar(0:10, rand_1x11_data3, rand_1x11_data4, ">"); %!demo +%! clf %! x = 0:0.5:2*pi; %! err = x/100; %! y1 = sin (x); @@ -155,6 +158,7 @@ %! hg = errorbar (x, y1, err, "~", x, y2, err, ">"); %!demo +%! clf %! x = 0:0.5:2*pi; %! err = x/100; %! y1 = sin (x); @@ -162,6 +166,7 @@ %! hg = errorbar (x, y1, err, err, "#r", x, y2, err, err, "#~"); %!demo +%! clf %! x = 0:0.5:2*pi; %! err = x/100; %! y1 = sin (x); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezcontour.m --- a/scripts/plot/ezcontour.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezcontour.m Wed Dec 21 21:19:48 2011 -0500 @@ -62,6 +62,7 @@ %!demo +%! clf %! f = @(x,y) sqrt(abs(x .* y)) ./ (1 + x.^2 + y.^2); %! ezcontour (f, [-3, 3]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezcontourf.m --- a/scripts/plot/ezcontourf.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezcontourf.m Wed Dec 21 21:19:48 2011 -0500 @@ -62,5 +62,6 @@ %!demo +%! clf %! f = @(x,y) sqrt(abs(x .* y)) ./ (1 + x.^2 + y.^2); %! ezcontourf (f, [-3, 3]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezmesh.m --- a/scripts/plot/ezmesh.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezmesh.m Wed Dec 21 21:19:48 2011 -0500 @@ -83,10 +83,12 @@ %!demo +%! clf %! f = @(x,y) sqrt(abs(x .* y)) ./ (1 + x.^2 + y.^2); %! ezmesh (f, [-3, 3]); %!demo +%! clf %! fx = @(s,t) cos (s) .* cos(t); %! fy = @(s,t) sin (s) .* cos(t); %! fz = @(s,t) sin (t); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezmeshc.m --- a/scripts/plot/ezmeshc.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezmeshc.m Wed Dec 21 21:19:48 2011 -0500 @@ -73,6 +73,7 @@ %!demo +%! clf %! f = @(x,y) sqrt(abs(x .* y)) ./ (1 + x.^2 + y.^2); %! ezmeshc (f, [-3, 3]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezplot.m --- a/scripts/plot/ezplot.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezplot.m Wed Dec 21 21:19:48 2011 -0500 @@ -81,11 +81,14 @@ %!demo +%! clf %! ezplot (@cos, @sin) %!demo +%! clf %! ezplot ("1/x") %!demo +%! clf %! ezplot (inline ("x^2 - y^2 = 1")) diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezplot3.m --- a/scripts/plot/ezplot3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezplot3.m Wed Dec 21 21:19:48 2011 -0500 @@ -61,6 +61,7 @@ %!demo +%! clf %! fx = @(t) cos (t); %! fy = @(t) sin (t); %! fz = @(t) t; diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezpolar.m --- a/scripts/plot/ezpolar.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezpolar.m Wed Dec 21 21:19:48 2011 -0500 @@ -56,5 +56,6 @@ %!demo +%! clf %! ezpolar (@(t) 1 + sin (t)); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezsurf.m --- a/scripts/plot/ezsurf.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezsurf.m Wed Dec 21 21:19:48 2011 -0500 @@ -83,10 +83,12 @@ %!demo +%! clf %! f = @(x,y) sqrt(abs(x .* y)) ./ (1 + x.^2 + y.^2); %! ezsurf (f, [-3, 3]); %!demo +%! clf %! fx = @(s,t) cos (s) .* cos(t); %! fy = @(s,t) sin (s) .* cos(t); %! fz = @(s,t) sin (t); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ezsurfc.m --- a/scripts/plot/ezsurfc.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ezsurfc.m Wed Dec 21 21:19:48 2011 -0500 @@ -73,6 +73,7 @@ %!demo +%! clf %! f = @(x,y) sqrt(abs(x .* y)) ./ (1 + x.^2 + y.^2); %! ezsurfc (f, [-3, 3]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/feather.m --- a/scripts/plot/feather.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/feather.m Wed Dec 21 21:19:48 2011 -0500 @@ -111,6 +111,7 @@ %!demo +%! clf %! phi = [0 : 15 : 360] * pi / 180; %! feather (sin (phi), cos (phi)) diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/fplot.m --- a/scripts/plot/fplot.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/fplot.m Wed Dec 21 21:19:48 2011 -0500 @@ -128,7 +128,9 @@ endfunction %!demo +%! clf %! fplot ("cos", [0, 2*pi]) %!demo +%! clf %! fplot ("[cos(x), sin(x)]", [0, 2*pi]) diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/loglogerr.m --- a/scripts/plot/loglogerr.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/loglogerr.m Wed Dec 21 21:19:48 2011 -0500 @@ -61,6 +61,7 @@ endfunction %!demo +%! clf %! x = exp (log(0.01):0.2:log(10)); %! y = wblpdf (x, 3, 2); %! eyu = 2*rand (size (y)) .* y; diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/pcolor.m --- a/scripts/plot/pcolor.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/pcolor.m Wed Dec 21 21:19:48 2011 -0500 @@ -87,6 +87,7 @@ %! pcolor(Z); %!demo +%! clf %! [X,Y,Z]=sombrero; %! [Fx,Fy] = gradient(Z); %! pcolor(X,Y,Fx+Fy); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/pie.m --- a/scripts/plot/pie.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/pie.m Wed Dec 21 21:19:48 2011 -0500 @@ -68,15 +68,18 @@ %!demo +%! clf %! pie ([3, 2, 1], [0, 0, 1]); %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); %!demo +%! clf %! pie ([3, 2, 1], [0, 0, 1], {"Cheddar", "Swiss", "Camembert"}); %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); %! axis ([-2,2,-2,2]); %!demo +%! clf %! pie ([0.17, 0.34, 0.41], {"Cheddar", "Swiss", "Camembert"}); %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); %! axis ([-2,2,-2,2]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/pie3.m --- a/scripts/plot/pie3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/pie3.m Wed Dec 21 21:19:48 2011 -0500 @@ -69,15 +69,18 @@ %!demo +%! clf %! pie3 ([5:-1:1], [0, 0, 1, 0, 0]); %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); %!demo +%! clf %! pie3 ([3, 2, 1], [0, 0, 1], {"Cheddar", "Swiss", "Camembert"}); %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); %! axis ([-2,2,-2,2]); %!demo +%! clf %! pie3 ([0.17, 0.34, 0.41], {"Cheddar", "Swiss", "Camembert"}); %! colormap ([1,0,0;0,1,0;0,0,1;1,1,0;1,0,1;0,1,1]); %! axis ([-2,2,-2,2]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/plot3.m --- a/scripts/plot/plot3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/plot3.m Wed Dec 21 21:19:48 2011 -0500 @@ -333,6 +333,7 @@ endfunction %!demo +%! clf %! z = [0:0.05:5]; %! plot3 (cos(2*pi*z), sin(2*pi*z), z, ";helix;"); %! plot3 (z, exp(2i*pi*z), ";complex sinusoid;"); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/plotmatrix.m --- a/scripts/plot/plotmatrix.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/plotmatrix.m Wed Dec 21 21:19:48 2011 -0500 @@ -96,6 +96,7 @@ endfunction %!demo +%! clf %! plotmatrix (randn (100, 3), 'g+') function plotmatrixdelete (h, d, ax) diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/quiver.m --- a/scripts/plot/quiver.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/quiver.m Wed Dec 21 21:19:48 2011 -0500 @@ -89,6 +89,7 @@ %! set (h, "maxheadsize", 0.33); %!demo +%! clf %! axis ("equal"); %! x = linspace (0,3,80); %! y = sin (2*pi*x); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/quiver3.m --- a/scripts/plot/quiver3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/quiver3.m Wed Dec 21 21:19:48 2011 -0500 @@ -106,5 +106,13 @@ %! hold off; %!demo +%! clf +%! [x, y, z] = peaks (25); +%! surf (x, y, z); +%! hold on; +%! [u, v, w] = surfnorm (x, y, z / 10); +%! h = quiver3 (x, y, z, u, v, w); +%! set (h, "maxheadsize", 0.33); +%! hold off; %! shading interp diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/refreshdata.m --- a/scripts/plot/refreshdata.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/refreshdata.m Wed Dec 21 21:19:48 2011 -0500 @@ -106,6 +106,7 @@ endfunction %!demo +%! clf %! x = 0:0.1:10; %! y = sin (x); %! plot (x, y, "ydatasource", "y"); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/ribbon.m --- a/scripts/plot/ribbon.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/ribbon.m Wed Dec 21 21:19:48 2011 -0500 @@ -88,6 +88,7 @@ %!demo +%! clf %! [x, y, z] = sombrero (); %! [x, y] = meshgrid (x, y); %! ribbon (y, z); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/rose.m --- a/scripts/plot/rose.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/rose.m Wed Dec 21 21:19:48 2011 -0500 @@ -106,5 +106,6 @@ %!demo +%! clf %! rose ([2*randn(1e5, 1), pi + 2*randn(1e5, 1)]); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/scatter3.m --- a/scripts/plot/scatter3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/scatter3.m Wed Dec 21 21:19:48 2011 -0500 @@ -84,22 +84,26 @@ %!demo +%! clf %! [x, y, z] = peaks (20); %! scatter3 (x(:), y(:), z(:), [], z(:)); %!demo +%! clf %! x = rand (20,1); %! y = rand (20,1); %! z = rand (20,1); %! scatter3 (x(:), y(:), z(:), 10, z(:), "s"); %!demo +%! clf %! x = rand (20,1); %! y = rand (20,1); %! z = rand (20,1); %! scatter3 (x(:), y(:), z(:), 20*z(:), z(:), "s"); %!demo +%! clf %! x = rand (20,1); %! y = rand (20,1); %! z = rand (20,1); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/semilogx.m --- a/scripts/plot/semilogx.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/semilogx.m Wed Dec 21 21:19:48 2011 -0500 @@ -64,6 +64,7 @@ %!demo +%! clf (); %! x = 1:0.01:10; %! y = (x .* (1 + rand (size (x)))) .^ 2; %! semilogx (y, x); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/semilogxerr.m --- a/scripts/plot/semilogxerr.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/semilogxerr.m Wed Dec 21 21:19:48 2011 -0500 @@ -61,6 +61,7 @@ endfunction %!demo +%! clf %! x = exp (log(0.01):0.2:log(10)); %! y = wblpdf (x, 2, 2); %! ey = 0.5*rand (size (y)) .* y; diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/semilogy.m --- a/scripts/plot/semilogy.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/semilogy.m Wed Dec 21 21:19:48 2011 -0500 @@ -64,6 +64,7 @@ endfunction %!demo +%! clf (); %! x = 1:0.01:10; %! y = (x .* (1 + rand (size (x)))) .^ 2; %! semilogy (x, y); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/semilogyerr.m --- a/scripts/plot/semilogyerr.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/semilogyerr.m Wed Dec 21 21:19:48 2011 -0500 @@ -61,6 +61,7 @@ endfunction %!demo +%! clf %! x = 0.25:0.25:10; %! y = wblpdf (x, 4, 2); %! eyu = rand (size (y)); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/shading.m --- a/scripts/plot/shading.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/shading.m Wed Dec 21 21:19:48 2011 -0500 @@ -82,26 +82,31 @@ %! title ('shading "faceted"') %!demo +%! clf %! sombrero %! shading flat %! title ('shading "flat"') %!demo +%! clf %! sombrero %! shading interp %! title ('shading "interp"') %!demo +%! clf %! pcolor (peaks ()) %! shading faceted %! title ('shading "faceted"') %!demo +%! clf %! pcolor (peaks ()) %! shading flat %! title ('shading "flat"') %!demo +%! clf %! pcolor (peaks ()) %! shading interp %! title ('shading "interp"') diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/sombrero.m --- a/scripts/plot/sombrero.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/sombrero.m Wed Dec 21 21:19:48 2011 -0500 @@ -62,4 +62,5 @@ endfunction %!demo +%! clf %! sombrero (); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/stairs.m --- a/scripts/plot/stairs.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/stairs.m Wed Dec 21 21:19:48 2011 -0500 @@ -210,12 +210,14 @@ %!demo +%! clf %! x = 1:10; %! rand_1x10_data1 = [0.073, 0.455, 0.837, 0.124, 0.426, 0.781, 0.004, 0.024, 0.519, 0.698]; %! y = rand_1x10_data1; %! stairs (x, y); %!demo +%! clf %! x = 1:10; %! rand_1x10_data2 = [0.014, 0.460, 0.622, 0.394, 0.531, 0.378, 0.466, 0.788, 0.342, 0.893]; %! y = rand_1x10_data2; @@ -223,9 +225,11 @@ %! plot (xs, ys); %!demo +%! clf %! stairs (1:9); %!demo +%! clf %! [xs, ys] = stairs (9:-1:1); %! plot (xs, ys); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/stem.m --- a/scripts/plot/stem.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/stem.m Wed Dec 21 21:19:48 2011 -0500 @@ -88,35 +88,42 @@ %!demo +%! clf %! x = 1:10; %! stem (x); %!demo +%! clf %! x = 1:10; %! y = 2*x; %! stem (x, y); %!demo +%! clf %! x = 1:10; %! y = 2*x; %! h = stem (x, y, "r"); %!demo +%! clf %! x = 1:10; %! y = 2*x; %! h = stem (x, y, "-.k"); %!demo +%! clf %! x = 1:10; %! y = 2*x; %! h = stem (x, y, "-.k."); %!demo +%! clf %! x = 1:10; %! y = 2*x; %! h = stem (x, y, "filled"); %!demo +%! clf %! x = [0 : 10]'; %! y = [sin(x), cos(x)]; %! h = stem (x, y); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/stem3.m --- a/scripts/plot/stem3.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/stem3.m Wed Dec 21 21:19:48 2011 -0500 @@ -53,5 +53,6 @@ endfunction %!demo +%! clf %! theta = 0:0.2:6; %! stem3 (cos (theta), sin (theta), theta) diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/surf.m --- a/scripts/plot/surf.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/surf.m Wed Dec 21 21:19:48 2011 -0500 @@ -71,12 +71,14 @@ %! surf (Z); %!demo +%! clf %! [~,~,Z] = sombrero; %! [Fx,Fy] = gradient (Z); %! surf (Z, Fx+Fy); %! shading interp; %!demo +%! clf %! [X,Y,Z] = sombrero; %! [~,Fy] = gradient (Z); %! surf (X, Y, Z, Fy); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/surfc.m --- a/scripts/plot/surfc.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/surfc.m Wed Dec 21 21:19:48 2011 -0500 @@ -80,12 +80,14 @@ %! surfc(Z); %!demo +%! clf %! [~,~,Z]=sombrero; %! [Fx,Fy] = gradient(Z); %! surfc(Z,Fx+Fy); %! shading interp; %!demo +%! clf %! [X,Y,Z]=sombrero; %! [~,Fy] = gradient(Z); %! surfc(X,Y,Z,Fy); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/surfl.m --- a/scripts/plot/surfl.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/surfl.m Wed Dec 21 21:19:48 2011 -0500 @@ -179,6 +179,7 @@ %! shading interp; %!demo +%! clf %! [X,Y,Z]=sombrero; %! colormap(copper); %! [az, el] = view; diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/surfnorm.m --- a/scripts/plot/surfnorm.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/surfnorm.m Wed Dec 21 21:19:48 2011 -0500 @@ -142,13 +142,16 @@ endfunction %!demo +%! clf %! colormap (jet (64)) %! [x, y, z] = peaks(10); %! surfnorm (x, y, z); %!demo +%! clf %! surfnorm (peaks(10)); %!demo +%! clf %! surfnorm (peaks(32)); %! shading interp diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/trimesh.m --- a/scripts/plot/trimesh.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/trimesh.m Wed Dec 21 21:19:48 2011 -0500 @@ -56,6 +56,7 @@ %!demo +%! clf %! old_state = rand ("state"); %! restore_state = onCleanup (@() rand ("state", old_state)); %! rand ("state", 10); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/triplot.m --- a/scripts/plot/triplot.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/triplot.m Wed Dec 21 21:19:48 2011 -0500 @@ -48,6 +48,7 @@ %!demo +%! clf %! old_state = rand ("state"); %! restore_state = onCleanup (@() rand ("state", old_state)); %! rand ("state", 2); diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/trisurf.m --- a/scripts/plot/trisurf.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/trisurf.m Wed Dec 21 21:19:48 2011 -0500 @@ -73,6 +73,7 @@ %!demo +%! clf %! old_state = rand ("state"); %! restore_state = onCleanup (@() rand ("state", old_state)); %! rand ("state", 10); @@ -84,6 +85,7 @@ %! trisurf (tri, x(:), y(:), z(:)); %!demo +%! clf %! x = rand (100, 1); %! y = rand (100, 1); %! z = x.^2 + y.^2; @@ -91,6 +93,7 @@ %! trisurf (tri, x, y, z); %!demo +%! clf %! x = rand (100, 1); %! y = rand (100, 1); %! z = x.^2 + y.^2; @@ -98,6 +101,7 @@ %! trisurf (tri, x, y, z, "facecolor", "interp"); %!demo +%! clf %! x = rand (100, 1); %! y = rand (100, 1); %! z = x.^2 + y.^2; diff -r c3ea07298af4 -r 22c50cbad2ce scripts/plot/uimenu.m --- a/scripts/plot/uimenu.m Wed Dec 21 21:01:22 2011 -0500 +++ b/scripts/plot/uimenu.m Wed Dec 21 21:19:48 2011 -0500 @@ -91,6 +91,7 @@ %!demo +%! clf %! surfl (peaks); %! colormap (copper); %! shading ("interp");