comparison scripts/plot/contour.m @ 17198:df4c4b7708a4

Add titles and clean-up plotting %!demos. * scripts/plot/area.m, scripts/plot/axis.m, scripts/plot/bar.m, scripts/plot/barh.m, scripts/plot/clabel.m, scripts/plot/colorbar.m, scripts/plot/comet.m, scripts/plot/comet3.m, scripts/plot/contour.m, scripts/plot/contour3.m, scripts/plot/contourf.m, scripts/plot/cylinder.m, scripts/plot/ellipsoid.m, scripts/plot/errorbar.m, scripts/plot/ezplot.m, scripts/plot/ezplot3.m, scripts/plot/ezpolar.m, scripts/plot/feather.m, scripts/plot/fplot.m, scripts/plot/hold.m, scripts/plot/isosurface.m, scripts/plot/legend.m, scripts/plot/loglog.m, scripts/plot/loglogerr.m, scripts/plot/mesh.m, scripts/plot/meshc.m, scripts/plot/meshz.m, scripts/plot/patch.m, scripts/plot/pcolor.m, scripts/plot/pie.m, scripts/plot/pie3.m, scripts/plot/plot.m, scripts/plot/plot3.m, scripts/plot/polar.m, scripts/plot/rectangle.m, scripts/plot/ribbon.m, scripts/plot/rose.m, scripts/plot/scatter.m, scripts/plot/scatter3.m, scripts/plot/semilogx.m, scripts/plot/semilogxerr.m, scripts/plot/semilogy.m, scripts/plot/semilogyerr.m, scripts/plot/sombrero.m, scripts/plot/stem3.m, scripts/plot/surf.m, scripts/plot/surfc.m, scripts/plot/surfl.m, scripts/plot/title.m, scripts/plot/waterfall.m: Add titles and clean-up plotting %!demos.
author Rik <rik@octave.org>
date Tue, 06 Aug 2013 14:34:20 -0700
parents 26589abbc78d
children 87ba70043bfc
comparison
equal deleted inserted replaced
17197:b1fd3dc31c42 17198:df4c4b7708a4
85 %!demo 85 %!demo
86 %! clf; 86 %! clf;
87 %! colormap ('default'); 87 %! colormap ('default');
88 %! [x, y, z] = peaks (); 88 %! [x, y, z] = peaks ();
89 %! contour (x, y, z); 89 %! contour (x, y, z);
90 %! title ('contour() plot of peaks() function');
91 %! title ({'contour() plot (isolines of constant Z)'; 'Z = peaks()');
90 92
91 %!demo 93 %!demo
92 %! clf; 94 %! clf;
93 %! colormap ('default'); 95 %! colormap ('default');
94 %! [theta, r] = meshgrid (linspace (0,2*pi,64), linspace (0,1,64)); 96 %! [theta, r] = meshgrid (linspace (0,2*pi,64), linspace (0,1,64));
95 %! [X, Y] = pol2cart (theta, r); 97 %! [X, Y] = pol2cart (theta, r);
96 %! Z = sin (2*theta) .* (1-r); 98 %! Z = sin (2*theta) .* (1-r);
97 %! contour (X, Y, abs (Z), 10); 99 %! contour (X, Y, abs (Z), 10);
98 100 %! title ({'contour() plot'; 'polar fcn Z = sin (2*theta) * (1-r)'});
99 %!demo
100 %! clf;
101 %! colormap ('default');
102 %! x = linspace (-2, 2);
103 %! [x, y] = meshgrid (x);
104 %! z = sqrt (x.^2 + y.^2) ./ (x.^2 + y.^2 + 1);
105 %! contourf (x, y, z, [0.4, 0.4]);
106 %! title ('The hole should be filled with the background color');
107 101
108 %!test 102 %!test
109 %! hf = figure ("visible", "off"); 103 %! hf = figure ("visible", "off");
110 %! clf (hf); 104 %! clf (hf);
111 %! unwind_protect 105 %! unwind_protect