Mercurial > octave-libtiff
changeset 22312:533c3c4059a3
Add titles to more of the graphic demos.
* imagesc.m, imshow.m, axis.m, daspect.m, datetick.m, material.m, camlight.m,
compass.m, isocaps.m, isonormals.m, isosurface.m, light.m, loglog.m, patch.m,
plot.m, plotyy.m, semilogx.m, semilogy.m, surfnorm.m, trisurf.m, hold.m:
Add titles to more of the graphic demos.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 16 Aug 2016 10:07:34 -0700 |
parents | ee54a83a89ad |
children | 7cd75d61bbae |
files | scripts/image/imagesc.m scripts/image/imshow.m scripts/plot/appearance/axis.m scripts/plot/appearance/daspect.m scripts/plot/appearance/datetick.m scripts/plot/appearance/material.m scripts/plot/draw/camlight.m scripts/plot/draw/compass.m scripts/plot/draw/isocaps.m scripts/plot/draw/isonormals.m scripts/plot/draw/isosurface.m scripts/plot/draw/light.m scripts/plot/draw/loglog.m scripts/plot/draw/patch.m scripts/plot/draw/plot.m scripts/plot/draw/plotyy.m scripts/plot/draw/semilogx.m scripts/plot/draw/semilogy.m scripts/plot/draw/surfnorm.m scripts/plot/draw/trisurf.m scripts/plot/util/hold.m |
diffstat | 21 files changed, 151 insertions(+), 93 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/imagesc.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/image/imagesc.m Tue Aug 16 10:07:34 2016 -0700 @@ -151,7 +151,7 @@ %! imagesc (g, g+12, cos (h/2)); %! axis ([0 10 0 22]); %! hold off; -%! title ("two consecutive images"); +%! title ("two consecutive images w/hold()"); %!demo %! clf; @@ -164,7 +164,7 @@ %! imagesc (g, g+12, cos (h/2)); %! axis ([0 10 0 22]); %! hold off; -%! title ("image, line, image"); +%! title ("image, line, image w/hold()"); %!demo %! clf; @@ -179,5 +179,5 @@ %! plot (g, 11.5 * ones (size (g))); %! axis ([0 10 0 22]); %! hold off; -%! title ("line, image, line, image, line"); +%! title ("line, image, line, image, line w/hold()");
--- a/scripts/image/imshow.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/image/imshow.m Tue Aug 16 10:07:34 2016 -0700 @@ -240,19 +240,23 @@ %!demo %! clf; %! imshow (rand (100, 100)); - -%!demo -%! clf; -%! imshow (rand (100, 100, 3)); - -%!demo -%! clf; -%! imshow (100*rand (100, 100, 3)); +%! title ({"imshow with random 100x100 matrix", "black and white"}); %!demo %! clf; %! imshow (rand (100, 100)); %! colormap (jet (64)); +%! title ({"imshow with random 100x100 matrix, "colormap() makes color image"}); + +%!demo +%! clf; +%! imshow (rand (100, 100, 3)); +%! title ({"imshow with random 100x100x3 matrix", "RGB color"}); + +%!demo +%! clf; +%! imshow (100*rand (100, 100, 3)); +%! title ({"imshow with random 100x100x3 matrix", "Indexed color"}); ## Test input validation %!error imshow ()
--- a/scripts/plot/appearance/axis.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/appearance/axis.m Tue Aug 16 10:07:34 2016 -0700 @@ -409,12 +409,12 @@ %! %! subplot (222); %! plot (t, x); -%! title ("square plot"); +%! title ("axis square"); %! axis ("square"); %! %! subplot (223); %! plot (t, x); -%! title ("equal plot"); +%! title ("axis equal"); %! axis ("equal"); %! %! subplot (224); @@ -429,13 +429,16 @@ %! %! subplot (121); %! plot (t, x); -%! title ("ij plot"); +%! title ({"axis ij", "Y-axis reversed"}); %! axis ("ij"); +%! legend ("sine"); %! %! subplot (122); %! plot (t, x); -%! title ("xy plot"); +%! title ("axis xy"); +%! title ({"axis ij", "Y-axis normal"}); %! axis ("xy"); +%! legend ("sine"); %!demo %! clf;
--- a/scripts/plot/appearance/daspect.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/appearance/daspect.m Tue Aug 16 10:07:34 2016 -0700 @@ -103,7 +103,7 @@ %! plot (x,cos(x), x,sin(x)); %! axis square; %! daspect ([1 1 1]); -%! title ("square plot-box with axis limits [0, 4, -2, 2]"); +%! title ("square plot box with axis limits [0, 4, -2, 2]"); %!demo %! clf; @@ -111,7 +111,7 @@ %! plot (x,cos (x), x,sin (x)); %! axis ([0 4 -1 1]); %! daspect ([2 1 1]); -%! title ("square plot-box with axis limits [0, 4, -1, 1]"); +%! title ("square plot box with axis limits [0, 4, -1, 1]"); %!demo %! clf; @@ -128,7 +128,7 @@ %! axis square; %! set (gca, "activepositionproperty", "position"); %! daspect ([1 1 1]); -%! title ("square plot-box with axis limits [0, 4, -2, 2]"); +%! title ("square plot box with axis limits [0, 4, -2, 2]"); %!demo %! clf; @@ -137,7 +137,7 @@ %! axis ([0 4 -1 1]); %! set (gca, "activepositionproperty", "position"); %! daspect ([2 1 1]); -%! title ("square plot-box with axis limits [0, 4, -1, 1]"); +%! title ("square plot box with axis limits [0, 4, -1, 1]"); ## FIXME: need some input validation tests
--- a/scripts/plot/appearance/datetick.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/appearance/datetick.m Tue Aug 16 10:07:34 2016 -0700 @@ -69,8 +69,9 @@ %! pop = [76.094, 92.407, 106.461, 123.077 131.954, 151.868, 179.979, ... %! 203.984, 227.225, 249.623, 282.224]; %! plot (datenum (yr, 1, 1), pop); -%! title ("US population (millions)"); %! xlabel ("Year"); +%! ylabel ("US population (millions)"); +%! title ("datetick() with 4-digit year format"); %! datetick ("x", "YYYY"); %!demo @@ -81,6 +82,7 @@ %! plot (yr, pr, "-o"); %! xlabel ("year"); %! ylabel ("average price"); +%! title ("datetick() with MM/DD/YY format"); %! ax = gca; %! set (ax, "xtick", datenum (1990:5:2005,1,1)); %! datetick ("x", 2, "keepticks");
--- a/scripts/plot/appearance/material.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/appearance/material.m Tue Aug 16 10:07:34 2016 -0700 @@ -203,9 +203,11 @@ %! isonormals (x, y, z, val, h_patch); %! axis equal; axis tight; %! view (3); +%! box off; %! drawnow (); %! light (); %! material ([0 0.5 1 10 .5]); +%! title ("material() with numeric input"); %!demo %! clf; @@ -215,6 +217,7 @@ %! view (3); %! light (); %! material metal; +%! title ("material metal"); %!test %! hf = figure ("Visible", "off");
--- a/scripts/plot/draw/camlight.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/camlight.m Tue Aug 16 10:07:34 2016 -0700 @@ -204,10 +204,12 @@ %! %! ## Add a second light %! camlight left +%! +%! title ({"camlight()", "lights are left and right"}); %!demo %! sphere (48); -%! title ("This light has a fixed position, even if the camera moves"); +%! title ({"camlight()", "light in fixed position ignores camera change"}); %! axis equal; %! shading flat; %! view (30, 30); @@ -222,7 +224,7 @@ %!demo %! sphere (48); -%! title ("Move the camera and update the light position"); +%! title ({"camlight()", "update light position with camera change"}); %! axis equal; shading flat %! view (30, 30); %!
--- a/scripts/plot/draw/compass.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/compass.m Tue Aug 16 10:07:34 2016 -0700 @@ -127,6 +127,7 @@ %! 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]); %! compass (eig (a)); +%! title ("compass() example"); ## Test input validation %!error compass ()
--- a/scripts/plot/draw/isocaps.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/isocaps.m Tue Aug 16 10:07:34 2016 -0700 @@ -392,6 +392,7 @@ %! "VertexNormals", repmat([0 -1 0], rows (fvc_zmax.vertices), 1)); %! axis equal; %! light (); +%! title ({"isocaps()", "sphere with 6 end-caps"}); %!demo %! v = smooth3 (rand (6, 8, 4));
--- a/scripts/plot/draw/isonormals.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/isonormals.m Tue Aug 16 10:07:34 2016 -0700 @@ -158,7 +158,7 @@ %! hp = patch ("Faces", fac, "Vertices", vert, "FaceVertexCData", cdat); %! vn = isonormals (x, y, z, val, vert); # Compute normals of isosurface %! set (hp, "VertexNormals", vn); # Manually set vertex normals -%! title ('"VertexNormals" from isonormals manually set'); +%! title ('set "VertexNormals" from isonormals'); %! isofinish (hp); %! %! subplot (2,2,4);
--- a/scripts/plot/draw/isosurface.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/isosurface.m Tue Aug 16 10:07:34 2016 -0700 @@ -369,7 +369,7 @@ %! v = x.^2 + y.^2 + z.^2; %! isosurface (x, y, z, v, 1); %! axis equal; -%! title ("isosurface of a sphere"); +%! title ("isosurface() of a sphere"); %!demo %! clf;
--- a/scripts/plot/draw/light.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/light.m Tue Aug 16 10:07:34 2016 -0700 @@ -146,7 +146,7 @@ %! axis equal %! view (2); %! light ("Position", [-1 1 1]); -%! title ("FaceLighting: none - flat - gouraud"); +%! title ({"FaceLighting", "none - flat - gouraud"}); %!demo %! ## multiple lights @@ -155,7 +155,8 @@ %! [x,y,z] = meshgrid (-2: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); -%! h_patch = patch (fv, "FaceColor", "w", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "w", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! isonormals (x, y, z, val, h_patch); %! axis equal; axis tight %! title ("Patch with one light"); @@ -163,7 +164,8 @@ %! h_light = light ("Color", "g"); %! %! h_axes2 = subplot (1, 2, 2); -%! h_patch2 = patch (fv, "FaceColor", "w", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch2 = patch (fv, "FaceColor", "w", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! isonormals (x, y, z, val, h_patch2); %! axis equal; axis tight %! title ("Patch with three lights"); @@ -180,41 +182,50 @@ %! val = (x.^2 + y.^2 + z.^2); %! %! fv = isosurface (x, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 0, "SpecularStrength", 0); %! isonormals (x, y, z, val, h_patch); %! fv = isosurface (x+.5, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 0, "SpecularStrength", .5); %! isonormals (x+.5, y, z, val, h_patch); %! fv = isosurface (x+1, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 0, "SpecularStrength", 1); %! isonormals (x+1, y, z, val, h_patch); %! %! fv = isosurface (x, y+.5, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 0.5, "SpecularStrength", 0); %! isonormals (x, y+.5, z, val, h_patch); %! fv = isosurface (x+.5, y+.5, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 0.5, "SpecularStrength", .5); %! isonormals (x+.5, y+.5, z, val, h_patch); %! fv = isosurface (x+1, y+.5, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 0.5, "SpecularStrength", 1); %! isonormals (x+1, y+.5, z, val, h_patch); %! %! fv = isosurface (x, y+1, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 1, "SpecularStrength", 0); %! isonormals (x, y+1, z, val, h_patch); %! fv = isosurface (x+.5, y+1, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 1, "SpecularStrength", .5); %! isonormals (x+.5, y+1, z, val, h_patch); %! fv = isosurface (x+1, y+1, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "DiffuseStrength", 1, "SpecularStrength", 1); %! isonormals (x+1, y+1, z, val, h_patch); %! @@ -224,7 +235,7 @@ %! %! xlabel ("SpecularStrength"); %! ylabel ("DiffuseStrength"); - +%! title ("Effects of SpecularStrength and DiffuseStrength"); %!demo %! ## Ambient Strength and Ambient Light Color @@ -235,15 +246,18 @@ %! h_axes1 = subplot (3,1,3); %! set (h_axes1, "AmbientLightColor", "g"); %! fv = isosurface (x, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", 0); %! isonormals (x, y, z, val, h_patch); %! fv = isosurface (x+.5, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", .7); %! isonormals (x+.5, y, z, val, h_patch); %! fv = isosurface (x+1, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", 1); %! isonormals (x+1, y, z, val, h_patch); %! h_light = light ("Position", [-1 1 1]); @@ -256,15 +270,18 @@ %! h_axes2 = subplot (3,1,2); %! set (h_axes2, "AmbientLightColor", [.5 0 1]); %! fv = isosurface (x, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", 0); %! isonormals (x, y, z, val, h_patch); %! fv = isosurface (x+.5, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", .7); %! isonormals (x+.5, y, z, val, h_patch); %! fv = isosurface (x+1, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", 1); %! isonormals (x+1, y, z, val, h_patch); %! h_light = light ("Position", [-1 1 1]); @@ -276,15 +293,18 @@ %! h_axes3 = subplot (3,1,1); %! set (h_axes3, "AmbientLightColor", "w"); %! fv = isosurface (x, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", 0); %! isonormals (x, y, z, val, h_patch); %! fv = isosurface (x+.5, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", .7); %! isonormals (x+.5, y, z, val, h_patch); %! fv = isosurface (x+1, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "AmbientStrength", 1); %! isonormals (x+1, y, z, val, h_patch); %! h_light = light ("Position", [-1 1 1]); @@ -292,6 +312,7 @@ %! axis equal %! view (2); %! ylabel ("AmbientLightColor [1 1 1]"); +%! title ("Effects of AmbientLightColor and AmbientStrength"); %!demo %! ## Specular Exponent @@ -301,15 +322,18 @@ %! %! h_axes = axes (); %! fv = isosurface (x, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularExponent", 15); %! isonormals (x, y, z, val, h_patch); %! fv = isosurface (x+.5, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularExponent", 5); %! isonormals (x+.5, y, z, val, h_patch); %! fv = isosurface (x+1, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularExponent", 1); %! isonormals (x+1, y, z, val, h_patch); %! h_light = light ("Position", [-1 1 1]); @@ -317,6 +341,7 @@ %! axis equal %! view (2); %! xlabel ("SpecularExponent"); +%! title ("Effects of SpecularExponent"); %!demo %! ## SpecularColorReflectance @@ -326,15 +351,18 @@ %! %! h_axes = axes (); %! fv = isosurface (x, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularColorReflectance", 0); %! isonormals (x, y, z, val, h_patch); %! fv = isosurface (x+.5, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularColorReflectance", 0.5); %! isonormals (x+.5, y, z, val, h_patch); %! fv = isosurface (x+1, y, z, val, .039); -%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", "FaceLighting", "Gouraud"); +%! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none", ... +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularColorReflectance", 1); %! isonormals (x+1, y, z, val, h_patch); %! h_light = light ("Position", [-1 1 1]); @@ -342,6 +370,7 @@ %! axis equal %! view (2); %! xlabel ("SpecularColorReflectance"); +%! title ("Effects of SpecularColorReflectance"); %!demo %! ## BackFaceLighting @@ -351,7 +380,7 @@ %! vn = isonormals (x, y, z, val, fv.vertices, "negate"); %! h_axes1 = subplot (1, 3, 1); %! h_patch = patch (fv, "FaceColor", "c", "EdgeColor", "none", ... -%! "FaceLighting", "Gouraud", "VertexNormals", vn); +%! "FaceLighting", "Gouraud", "VertexNormals", vn); %! set (h_patch, "BackFaceLighting", "reverselit"); %! h_light = light (); %! view (h_axes1, [-50 30]); @@ -360,7 +389,7 @@ %! %! h_axes2 = subplot (1, 3, 2); %! h_patch = patch (fv, "FaceColor", "c", "EdgeColor", "none", ... -%! "FaceLighting", "Gouraud", "VertexNormals", vn); +%! "FaceLighting", "Gouraud", "VertexNormals", vn); %! set (h_patch, "BackFaceLighting", "lit"); %! h_light = light (); %! view (h_axes2, [-50 30]); @@ -369,7 +398,7 @@ %! %! h_axes3 = subplot (1, 3, 3); %! h_patch = patch (fv, "FaceColor", "c", "EdgeColor", "none", ... -%! "FaceLighting", "Gouraud", "VertexNormals", vn); +%! "FaceLighting", "Gouraud", "VertexNormals", vn); %! set (h_patch, "BackFaceLighting", "unlit"); %! h_light = light (); %! view (h_axes3, [-50 30]); @@ -385,7 +414,7 @@ %! h_axes = axes (); %! fv = isosurface (x, y, z, val, .039, z); %! h_patch = patch (fv, "FaceColor", "flat", "EdgeColor", "none", ... -%! "FaceLighting", "Gouraud"); +%! "FaceLighting", "Gouraud"); %! set (h_patch, "SpecularExponent", 15); %! isonormals (x, y, z, val, h_patch); %! title ("Colored patch"); @@ -407,8 +436,9 @@ %! title ("Colored mesh (patch)"); %! h_light = light; %! lighting gouraud -%! axis tight -%! axis equal +%! axis tight; +%! axis equal; +%! box off; %! view (3); %!demo @@ -438,7 +468,7 @@ %! fv = isosurface (x, y, z, val, .039); %! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none"); %! isonormals (x, y, z, val, h_patch); -%! title ('"Style" set to "infinite" (default)'); +%! title ('"Style" = "infinite" (default)'); %! h_light = light ("Position", [.3 0 .3]); %! lighting gouraud %! axis equal @@ -448,7 +478,7 @@ %! fv = isosurface (x, y, z, val, .039); %! h_patch = patch (fv, "FaceColor", "r", "EdgeColor", "none"); %! isonormals (x, y, z, val, h_patch); -%! title ('"Style" set to "local"'); +%! title ('"Style" = "local"'); %! h_light = light ("Style", "local", "Position", [.3 0 .3]); %! lighting gouraud %! axis equal
--- a/scripts/plot/draw/loglog.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/loglog.m Tue Aug 16 10:07:34 2016 -0700 @@ -87,12 +87,12 @@ %! %! subplot (1,2,1); %! loglog (a, b); -%! xlabel ("loglog (a, b)"); +%! title ("loglog (a, b)"); %! %! subplot (1,2,2); %! loglog (a, abs (b)); %! set (gca, "ydir", "reverse"); -%! xlabel ("loglog (a, abs (b))"); +%! title ("loglog (a, abs (b))"); %!test %! hf = figure ("visible", "off");
--- a/scripts/plot/draw/patch.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/patch.m Tue Aug 16 10:07:34 2016 -0700 @@ -107,7 +107,6 @@ %!demo -%! ## Patches with same number of vertices %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/8:1)' + 1/32) * 2*pi; @@ -116,9 +115,9 @@ %! x2 = sin (t2) + 0.8; %! y2 = cos (t2); %! patch ([x1,x2], [y1,y2], "r"); +%! title ("patches with same number of vertices"); %!demo -%! ## Unclosed patch %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/16:1)' + 1/32) * 2*pi; @@ -127,9 +126,9 @@ %! x2 = sin (t2) + 0.8; %! y2 = cos (t2); %! patch ([[x1;NaN(8,1)],x2], [[y1;NaN(8,1)],y2], "r"); +%! title ("Unclosed patch by using NaN"); %!demo -%! ## Specify vertices and faces separately %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/16:1)' + 1/32) * 2*pi; @@ -140,9 +139,9 @@ %! vert = [x1, y1; x2, y2]; %! fac = [1:8,NaN(1,8);9:24]; %! patch ("Faces",fac, "Vertices",vert, "FaceColor","r"); +%! title ("patch() with separate specification of Faces and Vertices"); %!demo -%! ## Specify vertices and faces separately %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/16:1)' + 1/32) * 2*pi; @@ -154,6 +153,7 @@ %! fac = [1:8,NaN(1,8);9:24]; %! patch ("Faces",fac, "Vertices",vert, ... %! "FaceVertexCData",[0, 1, 0; 0, 0, 1], "FaceColor", "flat"); +%! title ("patch() with specification of color for each vertex"); %!demo %! ## Property change on multiple patches @@ -167,6 +167,7 @@ %! h = patch ([x1,x2], [y1,y2], cat (3, [0,0],[1,0],[0,1])); %! pause (1); %! set (h, "FaceColor", "r"); +%! title ("change color on multiple patch() objects"); %!demo %! clf; @@ -182,6 +183,8 @@ %! patch ("Vertices", vertices, "Faces", faces, ... %! "FaceVertexCData", jet (4), "FaceColor", "flat"); %! view (-37.5, 30); +%! box off; +%! title ('"FaceColor" = "flat"'); %!demo %! clf; @@ -197,6 +200,8 @@ %! patch ("Vertices", vertices, "Faces", faces, ... %! "FaceVertexCData", jet (5), "FaceColor", "interp"); %! view (-37.5, 30); +%! box off; +%! title ('"FaceColor" = "interp"'); %!demo %! clf; @@ -204,12 +209,12 @@ %! x = [0 1 1 0]; %! y = [0 0 1 1]; %! subplot (2,1,1); -%! title ("Blue, Light-Green, and Red Horizontal Bars"); +%! title ("Blue, Light Green, and Red Horizontal Bars"); %! patch (x, y + 0, 1); %! patch (x, y + 1, 2); %! patch (x, y + 2, 3); %! subplot (2,1,2); -%! title ("Blue, Light-Green, and Red Vertical Bars"); +%! title ("Blue, Light Green, and Red Vertical Bars"); %! patch (x + 0, y, 1 * ones (size (x))); %! patch (x + 1, y, 2 * ones (size (x))); %! patch (x + 2, y, 3 * ones (size (x)));
--- a/scripts/plot/draw/plot.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/plot.m Tue Aug 16 10:07:34 2016 -0700 @@ -268,7 +268,7 @@ %! plot (repmat (x, 2, 1), rand (2, numel (x)), "-s"); %! axis ([0 10 0 1]); %! title ({"Vertical lines with random height and lengths", ... -%! "x[2x11], y[2,11]"}) +%! "x[2x11], y[2,11]"}); %!demo %! x = 0:10; @@ -283,5 +283,5 @@ %! y = rand (shape); %! plot (x, y); %! axis ([0 10 0 1]); -%! title ({"Two random variables", "squeezed from 4-d arrays"}); +%! title ({"Two random variables", "squeezed from 4-D arrays"});
--- a/scripts/plot/draw/plotyy.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/plotyy.m Tue Aug 16 10:07:34 2016 -0700 @@ -287,7 +287,7 @@ %! "color", [0 0 1], "horizontalalignment", "center", "parent", ax(1)); %! text (4.5, 80, "Right Axis", ... %! "color", [0 0.5 0], "horizontalalignment", "center", "parent", ax(2)); -%! title ({"plotyy() example"; "Left axis uses @plot, Right axis uses @semilogy"}); +%! title ({"plotyy() example"; "left axis uses @plot, right axis uses @semilogy"}); %!demo %! clf;
--- a/scripts/plot/draw/semilogx.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/semilogx.m Tue Aug 16 10:07:34 2016 -0700 @@ -86,11 +86,11 @@ %! %! subplot (1,2,1); %! semilogx (x, y); -%! xlabel ("semilogx (x, y)"); +%! title ("semilogx (x, y)"); %! %! subplot (1,2,2); %! semilogx (-x, y); -%! xlabel ("semilogx (-x, y)"); +%! title ("semilogx (-x, y)"); %!demo %! clf; @@ -100,12 +100,12 @@ %! subplot (1,2,1); %! semilogx (x, y); %! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition"); -%! xlabel ({"semilogx (x, y)", "xdir = reversed"}); +%! title ({"semilogx (x, y)", "xdir = reversed"}); %! %! subplot (1,2,2); %! semilogx (-x, y); %! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition"); -%! xlabel ({"semilogx (-x, y)", "xdir = reversed"}); +%! title ({"semilogx (-x, y)", "xdir = reversed"}); %!test %! hf = figure ("visible", "off");
--- a/scripts/plot/draw/semilogy.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/semilogy.m Tue Aug 16 10:07:34 2016 -0700 @@ -86,11 +86,11 @@ %! %! subplot (2,1,1); %! semilogy (x, y); -%! ylabel ("semilogy (x, y)"); +%! title ("semilogy (x, y)"); %! %! subplot (2,1,2); %! semilogy (x, -y); -%! ylabel ("semilogy (x, -y)"); +%! title ("semilogy (x, -y)"); %!demo %! clf; @@ -100,12 +100,12 @@ %! subplot (2,1,1); %! semilogy (x, y); %! set (gca, "ydir", "reverse", "activepositionproperty", "outerposition"); -%! ylabel ({"semilogy (x, y)", "ydir = reversed"}); +%! title ({"semilogy (x, y)", "ydir = reversed"}); %! %! subplot (2,1,2); %! semilogy (x, -y); %! set (gca, "ydir", "reverse", "activepositionproperty", "outerposition"); -%! ylabel ({"semilogy (x, -y)", "ydir = reversed"}); +%! title ({"semilogy (x, -y)", "ydir = reversed"}); %!test %! hf = figure ("visible", "off");
--- a/scripts/plot/draw/surfnorm.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/surfnorm.m Tue Aug 16 10:07:34 2016 -0700 @@ -191,6 +191,8 @@ %! colormap ("default"); %! [x, y, z] = sombrero (10); %! surfnorm (x, y, z); +%! title ({"surfnorm() shows surface and normals at each vertex", ... +%! "sombrero() function with 10 faces"}); ## Test input validation %!error surfnorm ()
--- a/scripts/plot/draw/trisurf.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/draw/trisurf.m Tue Aug 16 10:07:34 2016 -0700 @@ -92,34 +92,36 @@ %!demo %! clf; -%! colormap ('default'); +%! colormap ("default"); %! N = 31; %! [x, y] = meshgrid (1:N); %! tri = delaunay (x(:), y(:)); %! z = peaks (N); -%! h = trisurf (tri, x, y, z, 'facecolor', 'interp'); +%! h = trisurf (tri, x, y, z, "facecolor", "interp"); %! axis tight; %! zlim auto; -%! title (sprintf ('facecolor = %s', get (h, 'facecolor'))); +%! title (sprintf ("facecolor = %s", get (h, "facecolor"))); %!demo %! clf; -%! colormap ('default'); +%! colormap ("default"); %! N = 31; %! [x, y] = meshgrid (1:N); %! tri = delaunay (x(:), y(:)); %! z = peaks (N); -%! h = trisurf (tri, x, y, z, 'facecolor', 'flat'); +%! h = trisurf (tri, x, y, z, "facecolor", "flat"); %! axis tight; %! zlim auto; -%! title (sprintf ('facecolor = %s', get (h, 'facecolor'))); +%! title (sprintf ("facecolor = %s", get (h, "facecolor"))); + +## FIXME: The demos below should each have a title %!demo %! clf; -%! colormap ('default'); -%! old_state = rand ('state'); -%! restore_state = onCleanup (@() rand ('state', old_state)); -%! rand ('state', 10); +%! colormap ("default"); +%! old_state = rand ("state"); +%! restore_state = onCleanup (@() rand ("state", old_state)); +%! rand ("state", 10); %! N = 10; %! x = 3 - 6 * rand (N, N); %! y = 3 - 6 * rand (N, N); @@ -129,7 +131,7 @@ %!demo %! clf; -%! colormap ('default'); +%! colormap ("default"); %! x = rand (100, 1); %! y = rand (100, 1); %! z = x.^2 + y.^2; @@ -138,12 +140,12 @@ %!demo %! clf; -%! colormap ('default'); +%! colormap ("default"); %! x = rand (100, 1); %! y = rand (100, 1); %! z = x.^2 + y.^2; %! tri = delaunay (x, y); -%! trisurf (tri, x, y, z, 'facecolor', 'interp'); +%! trisurf (tri, x, y, z, "facecolor", "interp"); %!demo %! clf;
--- a/scripts/plot/util/hold.m Tue Aug 16 18:19:31 2016 +0200 +++ b/scripts/plot/util/hold.m Tue Aug 16 10:07:34 2016 -0700 @@ -119,6 +119,7 @@ %! hold on; %! imagesc (1 ./ hilb (4)); %! plot (1:4, "-s"); +%! title ("hold with image and plot"); %! hold off; %!demo @@ -127,6 +128,7 @@ %! hold on; %! imagesc (1 ./ hilb (2)); %! imagesc (1 ./ hilb (4)); +%! title ({"hold with two images", "only second image is visible"}); %! hold off; %!demo @@ -135,6 +137,7 @@ %! hold on; %! plot (1:4, "-s"); %! imagesc (1 ./ hilb (4)); +%! title ({"hold with plot and image", "only image is visible"}); %! hold off; %!demo @@ -150,7 +153,7 @@ %! xlim ([-2.0 2.0]); %! ylim ([-2.0 2.0]); %! colorbar ("SouthOutside"); -%! title ("Test script for some plot functions"); +%! title ("hold with line, surface, and patch objects"); ## hold on test %!test