# HG changeset patch # User Rik # Date 1327246292 28800 # Node ID 4506eade9f042381bfa62a65a33e808ede729065 # Parent a529256662886209928b9cf1f9ee19e545ab0542 Use Matlab coding conventions for demos in plot/ directory. * contrast.m, axis.m, clabel.m, colorbar.m, comet.m, contour.m, contour3.m, cylinder.m, daspect.m, errorbar.m, ezplot.m, fplot.m, grid.m, hold.m, isosurface.m, legend.m, loglog.m, loglogerr.m, pareto.m, patch.m, pbaspect.m, pie.m, pie3.m, plot3.m, plotmatrix.m, plotyy.m, quiver.m, quiver3.m, rectangle.m, refreshdata.m, scatter.m, scatter3.m, semilogx.m, semilogxerr.m, semilogy.m, semilogyerr.m, shading.m, stem.m, subplot.m, text.m, title.m, trimesh.m, triplot.m, trisurf.m, uigetdir.m, uigetfile.m, uimenu.m, uiputfile.m, waitbar.m, xlim.m, ylim.m, zlim.m: Use Matlab coding conventions for demos so that compare plots scripts will function. diff --git a/scripts/image/contrast.m b/scripts/image/contrast.m --- a/scripts/image/contrast.m +++ b/scripts/image/contrast.m @@ -17,10 +17,11 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} contrast (@var{x}, @var{n}) +## @deftypefn {Function File} {} contrast (@var{x}) +## @deftypefnx {Function File} {} contrast (@var{x}, @var{n}) ## Return a gray colormap that maximizes the contrast in an image. The ## returned colormap will have @var{n} rows. If @var{n} is not defined -## then the size of the current colormap is used instead. +## then the size of the current colormap is used. ## @seealso{colormap} ## @end deftypefn @@ -42,12 +43,19 @@ minm = min (map); map = (map - minm) ./ (max (map) - minm); map = [map, map, map]; + endfunction %!demo -%! image (reshape (1:100, 10, 10)); -%! colormap (contrast (1:100, 10)); +%! clf; +%! img = reshape (1:100, 10, 10); +%! image (img); +%! colormap (gray (10)); +%! title ("Image with default 256 gray levels"); +%! input ("Press to continue: ", "s"); +%! colormap (contrast (img)); +%! title ("Image with contrast enhanced"); %!assert (contrast (1:100,10), [([0:9]/9)',([0:9]/9)',([0:9]/9)'], 1e-10) diff --git a/scripts/plot/axis.m b/scripts/plot/axis.m --- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -360,22 +360,22 @@ %! %! subplot (221); %! plot (t, x); -%! title ("normal plot"); +%! title ('normal plot'); %! %! subplot (222); %! plot (t, x); -%! title ("square plot"); -%! axis ("square"); +%! title ('square plot'); +%! axis ('square'); %! %! subplot (223); %! plot (t, x); -%! title ("equal plot"); -%! axis ("equal"); +%! title ('equal plot'); +%! axis ('equal'); %! %! subplot (224); %! plot (t, x); -%! title ("normal plot again"); -%! axis ("normal"); +%! title ('normal plot again'); +%! axis ('normal'); %!demo %! clf; @@ -384,13 +384,13 @@ %! %! subplot (121); %! plot (t, x); -%! title ("ij plot"); -%! axis ("ij"); +%! title ('ij plot'); +%! axis ('ij'); %! %! subplot (122); %! plot (t, x); -%! title ("xy plot"); -%! axis ("xy"); +%! title ('xy plot'); +%! axis ('xy'); %!demo %! clf; @@ -399,48 +399,48 @@ %! %! subplot (331); %! plot (t, x); -%! title ("x tics and labels"); -%! axis ("ticx"); +%! title ('x tics and labels'); +%! axis ('ticx'); %! %! subplot (332); %! plot (t, x); -%! title ("y tics and labels"); -%! axis ("ticy"); +%! title ('y tics and labels'); +%! axis ('ticy'); %! %! subplot (333); %! plot (t, x); -%! title ("axis off"); -%! axis ("off"); +%! title ('axis off'); +%! axis ('off'); %! %! subplot (334); %! plot (t, x); -%! title ("x and y tics, x labels"); -%! axis ("labelx","tic"); +%! title ('x and y tics, x labels'); +%! axis ('labelx','tic'); %! %! subplot (335); %! plot (t, x); -%! title ("x and y tics, y labels"); -%! axis ("labely","tic"); +%! title ('x and y tics, y labels'); +%! axis ('labely','tic'); %! %! subplot (336); %! plot (t, x); -%! title ("all tics but no labels"); -%! axis ("nolabel","tic"); +%! title ('all tics but no labels'); +%! axis ('nolabel','tic'); %! %! subplot (337); %! plot (t, x); -%! title ("x tics, no labels"); -%! axis ("nolabel","ticx"); +%! title ('x tics, no labels'); +%! axis ('nolabel','ticx'); %! %! subplot (338); %! plot (t, x); -%! title ("y tics, no labels"); -%! axis ("nolabel","ticy"); +%! title ('y tics, no labels'); +%! axis ('nolabel','ticy'); %! %! subplot (339); %! plot (t, x); -%! title ("all tics and labels"); -%! axis ("on"); +%! title ('all tics and labels'); +%! axis ('on'); %!demo %! clf; @@ -449,43 +449,43 @@ %! %! subplot (321); %! plot (t, x); -%! title ("axes at [0 3 0 1]"); +%! title ('axes at [0 3 0 1]'); %! axis ([0,3,0,1]); %! %! subplot (322); %! plot (t, x); -%! title ("auto"); -%! axis ("auto"); +%! title ('auto'); +%! axis ('auto'); %! %! subplot (323); -%! plot (t, x, ";sine [0:2pi];"); hold on; -%! plot (-3:3,-3:3, ";line (-3,-3)->(3,3);"); hold off; -%! title ("manual"); -%! axis ("manual"); +%! plot (t, x, ';sine [0:2pi];'); hold on; +%! plot (-3:3,-3:3, ';line (-3,-3)->(3,3);'); hold off; +%! title ('manual'); +%! axis ('manual'); %! %! subplot (324); -%! plot (t, x, ";sine [0:2pi];"); -%! title ("axes at [0 3 0 1], then autox"); +%! plot (t, x, ';sine [0:2pi];'); +%! title ('axes at [0 3 0 1], then autox'); %! axis ([0,3,0,1]); -%! axis ("autox"); +%! axis ('autox'); %! %! subplot (325); -%! plot (t, x, ";sine [0:2p];"); -%! title ("axes at [3 6 0 1], then autoy"); +%! plot (t, x, ';sine [0:2p];'); +%! title ('axes at [3 6 0 1], then autoy'); %! axis ([3,6,0,1]); -%! axis ("autoy"); +%! axis ('autoy'); %! %! subplot (326); %! plot (t, sin(t), t, -2*sin(t/2)); -%! axis ("tight"); -%! title ("tight"); +%! axis ('tight'); +%! title ('tight'); %!demo %! clf; %! x = 0:0.1:10; %! plot (x, sin(x)); %! axis image; -%! title ("image"); +%! title ('image'); %!demo %! clf; @@ -502,13 +502,13 @@ %! clf; %! x = -10:10; %! plot (x,x, x,-x); -%! set (gca, "yscale", "log"); -%! legend ({"x >= 1", "x <= 1"}, "location", "north"); -%! title ("ylim = [1, 10]"); +%! set (gca, 'yscale', 'log'); +%! legend ({'x >= 1', 'x <= 1'}, 'location', 'north'); +%! title ('ylim = [1, 10]'); %!demo %! clf; -%! loglog (1:20, "-s"); +%! loglog (1:20, '-s'); %! axis tight; %!demo @@ -516,9 +516,9 @@ %! x = -10:0.1:10; %! y = sin (x)./(1 + abs (x)) + 0.1*x - 0.4; %! plot (x, y); -%! title ("no plot box"); -%! set (gca, "xaxislocation", "zero"); -%! set (gca, "yaxislocation", "zero"); +%! title ('no plot box'); +%! set (gca, 'xaxislocation', 'zero'); +%! set (gca, 'yaxislocation', 'zero'); %! box off; %!demo @@ -526,9 +526,9 @@ %! x = -10:0.1:10; %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; %! plot (x, y); -%! title ("no plot box"); -%! set (gca, "xaxislocation", "zero"); -%! set (gca, "yaxislocation", "left"); +%! title ('no plot box'); +%! set (gca, 'xaxislocation', 'zero'); +%! set (gca, 'yaxislocation', 'left'); %! box off; %!demo @@ -536,9 +536,9 @@ %! x = -10:0.1:10; %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; %! plot (x, y); -%! title ("no plot box"); -%! set (gca, "xaxislocation", "zero"); -%! set (gca, "yaxislocation", "right"); +%! title ('no plot box'); +%! set (gca, 'xaxislocation', 'zero'); +%! set (gca, 'yaxislocation', 'right'); %! box off; %!demo @@ -546,9 +546,9 @@ %! x = -10:0.1:10; %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; %! plot (x, y); -%! title ("no plot box"); -%! set (gca, "xaxislocation", "bottom"); -%! set (gca, "yaxislocation", "zero"); +%! title ('no plot box'); +%! set (gca, 'xaxislocation', 'bottom'); +%! set (gca, 'yaxislocation', 'zero'); %! box off; %!demo @@ -556,9 +556,9 @@ %! x = -10:0.1:10; %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; %! plot (x, y); -%! title ("no plot box"); -%! set (gca, "xaxislocation", "top"); -%! set (gca, "yaxislocation", "zero"); +%! title ('no plot box'); +%! set (gca, 'xaxislocation', 'top'); +%! set (gca, 'yaxislocation', 'zero'); %! box off; %!test diff --git a/scripts/plot/clabel.m b/scripts/plot/clabel.m --- a/scripts/plot/clabel.m +++ b/scripts/plot/clabel.m @@ -134,10 +134,10 @@ %!demo %! clf; %! [c, h] = contour (peaks (), -4:6); -%! clabel (c, h, -4:2:6, "fontsize", 12); +%! clabel (c, h, -4:2:6, 'fontsize', 12); %!demo %! clf; %! [c, h] = contourf (peaks (), -7:6); -%! clabel (c, h, -6:2:6, "fontsize", 12); +%! clabel (c, h, -6:2:6, 'fontsize', 12); diff --git a/scripts/plot/colorbar.m b/scripts/plot/colorbar.m --- a/scripts/plot/colorbar.m +++ b/scripts/plot/colorbar.m @@ -373,39 +373,39 @@ %! clf; %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); %! imagesc (x); -%! colorbar ("westoutside"); +%! colorbar ('westoutside'); %!demo %! clf; %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); %! imagesc (x); -%! colorbar ("peer", gca (), "northoutside"); +%! colorbar ('peer', gca (), 'northoutside'); %!demo %! clf; %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); %! imagesc (x); -%! colorbar ("southoutside"); +%! colorbar ('southoutside'); %!demo %! clf; %! contour (peaks ()); -%! colorbar ("west"); +%! colorbar ('west'); %!demo %! clf; %! subplot (2,2,1); %! contour (peaks ()); -%! colorbar ("east"); +%! colorbar ('east'); %! subplot (2,2,2); %! contour (peaks ()); -%! colorbar ("west"); +%! colorbar ('west'); %! subplot (2,2,3); %! contour (peaks ()); -%! colorbar ("north"); +%! colorbar ('north'); %! subplot (2,2,4); %! contour (peaks ()); -%! colorbar ("south"); +%! colorbar ('south'); %!demo %! clf; @@ -415,13 +415,13 @@ %! colorbar (); %! subplot (2,2,2); %! imagesc (x); -%! colorbar ("westoutside"); +%! colorbar ('westoutside'); %! subplot (2,2,3); %! imagesc (x); -%! colorbar ("northoutside"); +%! colorbar ('northoutside'); %! subplot (2,2,4); %! imagesc (x); -%! colorbar ("southoutside"); +%! colorbar ('southoutside'); %!demo %! clf; @@ -433,7 +433,7 @@ %! subplot (1,2,2); %! imagesc (x); %! axis square; -%! colorbar ("westoutside"); +%! colorbar ('westoutside'); %!demo %! clf; @@ -441,11 +441,11 @@ %! subplot (1,2,1); %! imagesc (x); %! axis square; -%! colorbar ("northoutside"); +%! colorbar ('northoutside'); %! subplot (1,2,2); %! imagesc (x); %! axis square; -%! colorbar ("southoutside"); +%! colorbar ('southoutside'); %!demo %! clf; @@ -457,7 +457,7 @@ %! subplot (2,1,2); %! imagesc (x); %! axis square; -%! colorbar ("westoutside"); +%! colorbar ('westoutside'); %!demo %! clf; @@ -465,11 +465,11 @@ %! subplot (2,1,1); %! imagesc (x); %! axis square; -%! colorbar ("northoutside"); +%! colorbar ('northoutside'); %! subplot (2,1,2); %! imagesc (x); %! axis square; -%! colorbar ("southoutside"); +%! colorbar ('southoutside'); %!demo %! clf; @@ -479,17 +479,17 @@ %! colorbar (); %! subplot (1,2,2); %! imagesc (x); -%! colorbar ("westoutside"); +%! colorbar ('westoutside'); %!demo %! clf; %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); %! subplot (1,2,1); %! imagesc (x); -%! colorbar ("northoutside"); +%! colorbar ('northoutside'); %! subplot (1,2,2); %! imagesc (x); -%! colorbar ("southoutside"); +%! colorbar ('southoutside'); %!demo %! clf; @@ -499,17 +499,17 @@ %! colorbar (); %! subplot (2,1,2); %! imagesc (x); -%! colorbar ("westoutside"); +%! colorbar ('westoutside'); %!demo %! clf; %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); %! subplot (2,1,1); %! imagesc (x); -%! colorbar ("northoutside"); +%! colorbar ('northoutside'); %! subplot (2,1,2); %! imagesc (x); -%! colorbar ("southoutside"); +%! colorbar ('southoutside'); %!demo %! clf; @@ -517,12 +517,12 @@ %! subplot (1,2,1); %! contour (x); %! axis square; -%! colorbar ("east"); +%! colorbar ('east'); %! xlim ([1, 64]); %! ylim ([1, 64]); %! subplot (1,2,2); %! contour (x); -%! colorbar ("west"); +%! colorbar ('west'); %! xlim ([1, 64]); %! ylim ([1, 64]); @@ -547,14 +547,14 @@ %! clf; %! imagesc (1 ./ hilb (99)); %! h = colorbar (); -%! set (h, "yscale", "log"); +%! set (h, 'yscale', 'log'); %!demo %! clf; %! imagesc (log10 (1 ./ hilb (99))); %! h = colorbar (); -%! ytick = get (h, "ytick"); -%! set (h, "yticklabel", sprintf ("10^{%g}|", ytick)); +%! ytick = get (h, 'ytick'); +%! set (h, 'yticklabel', sprintf ('10^{%g}|', ytick)); %!demo %! clf; @@ -577,7 +577,7 @@ %! axis equal; %! colorbar (); -## This requires that the axes position be properly determined for "axis equal" +## This requires that the axes position be properly determined for 'axis equal' %!demo %! clf; %! axes; @@ -589,32 +589,32 @@ %!demo %! clf; %! plot ([0, 2]); -%! colorbar ("east"); +%! colorbar ('east'); %! axis square; %!demo %! clf; %! plot ([0, 2]); -%! colorbar ("eastoutside"); +%! colorbar ('eastoutside'); %! axis square; %!demo %! clf; %! pcolor (peaks (20)); %! shading interp; -%! axis ("tight", "square"); +%! axis ('tight', 'square'); %! colorbar (); -#%! axes ("color","none","box","on","activepositionproperty","position"); +#%! axes ('color','none','box','on','activepositionproperty','position'); %!demo %! clf; %! plot ([0, 2]); -%! colorbar ("east"); +%! colorbar ('east'); %! axis equal; %!demo %! clf; %! plot ([0, 2]); -%! colorbar ("eastoutside"); +%! colorbar ('eastoutside'); %! axis equal; diff --git a/scripts/plot/comet.m b/scripts/plot/comet.m --- a/scripts/plot/comet.m +++ b/scripts/plot/comet.m @@ -84,5 +84,5 @@ %! t = 0:.1:2*pi; %! x = cos (2*t) .* (cos (t).^2); %! y = sin (2*t) .* (sin (t).^2); -%! comet (x,y); +%! comet (x, y); diff --git a/scripts/plot/contour.m b/scripts/plot/contour.m --- a/scripts/plot/contour.m +++ b/scripts/plot/contour.m @@ -89,5 +89,5 @@ %! [x, y] = meshgrid (x); %! z = sqrt (x.^2 + y.^2) ./ (x.^2 + y.^2 + 1); %! contourf (x, y, z, [0.4, 0.4]); -%! title ("The hole should be filled with the background color"); +%! title ('The hole should be filled with the background color'); diff --git a/scripts/plot/contour3.m b/scripts/plot/contour3.m --- a/scripts/plot/contour3.m +++ b/scripts/plot/contour3.m @@ -79,7 +79,7 @@ %! clf; %! contour3 (peaks (19)); %! hold on; -%! surface (peaks (19), "facecolor", "none", "edgecolor", "black"); +%! surface (peaks (19), 'facecolor', 'none', 'edgecolor', 'black'); %! colormap (hot (64)); %! axis tight; %! zlim auto; diff --git a/scripts/plot/cylinder.m b/scripts/plot/cylinder.m --- a/scripts/plot/cylinder.m +++ b/scripts/plot/cylinder.m @@ -90,5 +90,5 @@ %! clf; %! [x, y, z] = cylinder (10:-1:0,50); %! surf (x, y, z); -%! title ("a cone"); +%! title ('a cone'); diff --git a/scripts/plot/daspect.m b/scripts/plot/daspect.m --- a/scripts/plot/daspect.m +++ b/scripts/plot/daspect.m @@ -96,7 +96,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; @@ -104,7 +104,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; @@ -112,23 +112,23 @@ %! plot (x,cos(x), x,sin(x)); %! daspect ([1 2 1]); %! pbaspect ([2 1 1]); -%! title ("2x1 plot box with axis limits [0, 4, -2, 2]"); +%! title ('2x1 plot box with axis limits [0, 4, -2, 2]'); %!demo %! clf; %! x = 0:0.01:4; %! plot (x,cos(x), x, sin(x)); %! axis square; -%! set (gca, "activepositionproperty", "position"); +%! 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; %! x = 0:0.01:4; %! plot (x,cos(x), x,sin(x)); %! axis ([0 4 -1 1]); -%! set (gca, "activepositionproperty", "position"); +%! 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]'); diff --git a/scripts/plot/errorbar.m b/scripts/plot/errorbar.m --- a/scripts/plot/errorbar.m +++ b/scripts/plot/errorbar.m @@ -147,7 +147,7 @@ %! 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, ">"); +%! errorbar (0:10, rand_1x11_data3, rand_1x11_data4, '>'); %!demo %! clf; @@ -155,7 +155,7 @@ %! err = x/100; %! y1 = sin (x); %! y2 = cos (x); -%! hg = errorbar (x, y1, err, "~", x, y2, err, ">"); +%! hg = errorbar (x, y1, err, '~', x, y2, err, '>'); %!demo %! clf; @@ -163,7 +163,7 @@ %! err = x/100; %! y1 = sin (x); %! y2 = cos (x); -%! hg = errorbar (x, y1, err, err, "#r", x, y2, err, err, "#~"); +%! hg = errorbar (x, y1, err, err, '#r', x, y2, err, err, '#~'); %!demo %! clf; @@ -171,6 +171,6 @@ %! err = x/100; %! y1 = sin (x); %! y2 = cos (x); -%! hg = errorbar (x, y1, err, err, err, err, "~>", ... -%! x, y2, err, err, err, err, "#~>-*"); +%! hg = errorbar (x, y1, err, err, err, err, '~>', ... +%! x, y2, err, err, err, err, '#~>-*'); diff --git a/scripts/plot/ezplot.m b/scripts/plot/ezplot.m --- a/scripts/plot/ezplot.m +++ b/scripts/plot/ezplot.m @@ -87,9 +87,9 @@ %!demo %! clf; -%! ezplot ("1/x"); +%! ezplot ('1/x'); %!demo %! clf; -%! ezplot (inline ("x^2 - y^2 = 1")); +%! ezplot (inline ('x^2 - y^2 = 1')); diff --git a/scripts/plot/fplot.m b/scripts/plot/fplot.m --- a/scripts/plot/fplot.m +++ b/scripts/plot/fplot.m @@ -130,9 +130,9 @@ %!demo %! clf; -%! fplot ("cos", [0, 2*pi]); +%! fplot ('cos', [0, 2*pi]); %!demo %! clf; -%! fplot ("[cos(x), sin(x)]", [0, 2*pi]); +%! fplot ('[cos(x), sin(x)]', [0, 2*pi]); diff --git a/scripts/plot/grid.m b/scripts/plot/grid.m --- a/scripts/plot/grid.m +++ b/scripts/plot/grid.m @@ -104,17 +104,17 @@ %! subplot (2,2,1); %! plot (1:100); %! grid off; -%! title ("no grid"); +%! title ('no grid'); %! subplot (2,2,2); %! plot (1:100); %! grid on; -%! title ("grid on"); +%! title ('grid on'); %! subplot (2,2,3); %! plot (1:100); %! grid minor; -%! title ("grid minor"); +%! title ('grid minor'); %! subplot (2,2,4); %! semilogy (1:100); %! grid minor; -%! title ("grid minor"); +%! title ('grid minor'); diff --git a/scripts/plot/hold.m b/scripts/plot/hold.m --- a/scripts/plot/hold.m +++ b/scripts/plot/hold.m @@ -108,7 +108,7 @@ %! clf; %! hold on; %! imagesc (1 ./ hilb (4)); -%! plot (1:4, "-s"); +%! plot (1:4, '-s'); %! hold off; %!demo @@ -121,7 +121,7 @@ %!demo %! clf; %! hold on; -%! plot (1:4, "-s"); +%! plot (1:4, '-s'); %! imagesc (1 ./ hilb (4)); %! hold off; @@ -133,12 +133,12 @@ %! z = peaks (x, y); %! contourf (x, y, z, 10); %! hold on; -%! plot (vec (x), vec (y), "^"); -%! patch ([-1.0 1.0 1.0 -1.0 -1.0], [-1.0 -1.0 1.0 1.0 -1.0], "red"); +%! plot (vec (x), vec (y), '^'); +%! patch ([-1.0 1.0 1.0 -1.0 -1.0], [-1.0 -1.0 1.0 1.0 -1.0], 'red'); %! xlim ([-2.0 2.0]); %! ylim ([-2.0 2.0]); -%! colorbar ("SouthOutside"); -%! title ("Test script for some plot functions"); +%! colorbar ('SouthOutside'); +%! title ('Test script for some plot functions'); ##hold on %!test diff --git a/scripts/plot/isosurface.m b/scripts/plot/isosurface.m --- a/scripts/plot/isosurface.m +++ b/scripts/plot/isosurface.m @@ -197,9 +197,9 @@ %! isosurface (x, y, z, v, 1); %!shared x, y, z, val -%! [x, y, z] = meshgrid (0:1, 0:1, 0:1); ## Points for single -%! val = [0, 0; 0, 0]; ## cube and a 3-D -%! val(:,:,2) = [0, 0; 1, 0]; ## array of values +%! [x, y, z] = meshgrid (0:1, 0:1, 0:1); %% Points for single +%! val = [0, 0; 0, 0]; %% cube and a 3-D +%! val(:,:,2) = [0, 0; 1, 0]; %% array of values %!test %! fv = isosurface (x, y, z, val, 0.3); %! assert (isfield (fv, "vertices"), true); diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -976,89 +976,89 @@ %!demo %! clf; %! x = 0:1; -%! plot (x,x,";I am Blue;", x,2*x,";I am Green;", x,3*x,";I am Red;"); +%! plot (x,x,';I am Blue;', x,2*x,';I am Green;', x,3*x,';I am Red;'); %!demo %! clf; %! x = 0:1; -%! plot (x, x, ";\alpha;", -%! x, 2*x, ";\beta=2\alpha;", -%! x, 3*x, ";\gamma=3\alpha;"); +%! plot (x, x, ';\alpha;', ... +%! x, 2*x, ';\beta=2\alpha;', ... +%! x, 3*x, ';\gamma=3\alpha;'); %!demo %! clf; %! x = 0:1; -%! plot (x,x,";I am Blue;", x,2*x, x,3*x,";I am Red;"); -%! title ("Blue and Green keys, with Green missing"); +%! plot (x,x,';I am Blue;', x,2*x, x,3*x,';I am Red;'); +%! title ('Blue and Green keys, with Green missing'); %!demo %! clf; %! plot (1:10, 1:10, 1:10, fliplr (1:10)); -%! title ("incline is blue and decline is green"); -%! legend ({"I am blue", "I am green"}, "location", "east"); +%! title ('incline is blue and decline is green'); +%! legend ({'I am blue', 'I am green'}, 'location', 'east'); %!demo %! clf; %! plot (1:10, 1:10, 1:10, fliplr (1:10)); -%! title ("Legend is hidden") -%! legend ({"I am blue", "I am green"}, "location", "east"); +%! title ('Legend is hidden') +%! legend ({'I am blue', 'I am green'}, 'location', 'east'); %! legend hide; %!demo %! clf; %! plot (1:10, 1:10, 1:10, fliplr (1:10)); -%! title ("Legend with box on"); -%! legend ({"I am blue", "I am green"}, "location", "east"); +%! title ('Legend with box on'); +%! legend ({'I am blue', 'I am green'}, 'location', 'east'); %! legend boxon; %!demo %! clf; %! plot (1:10, 1:10, 1:10, fliplr (1:10)); -%! title ("Legend with text to the right"); -%! legend ({"I am blue", "I am green"}, "location", "east"); +%! title ('Legend with text to the right'); +%! legend ({'I am blue', 'I am green'}, 'location', 'east'); %! legend right; %!demo %! clf; %! plot (1:10, 1:10); -%! title ("a very long label can sometimes cause problems"); -%! legend ({"hello world"}, "location", "northeastoutside"); +%! title ('a very long label can sometimes cause problems'); +%! legend ({'hello world'}, 'location', 'northeastoutside'); %!demo %! clf; %! plot (1:10, 1:10); -%! title ("a very long label can sometimes cause problems"); -%! legend ("hello world", "location", "northeastoutside"); +%! title ('a very long label can sometimes cause problems'); +%! legend ('hello world', 'location', 'northeastoutside'); %!demo %! clf; %! labels = {}; -%! colororder = get (gca, "colororder"); +%! colororder = get (gca, 'colororder'); %! for i = 1:5 %! h = plot (1:100, i + rand(100,1)); hold on; -%! set (h, "color", colororder(i,:)); -%! labels = {labels{:}, cstrcat("Signal ", num2str (i))}; -%! endfor +%! set (h, 'color', colororder(i,:)); +%! labels = {labels{:}, cstrcat('Signal ', num2str (i))}; +%! end %! hold off; -%! title ("Signals with random offset and uniform noise"); -%! xlabel ("Sample Nr [k]"); ylabel ("Amplitude [V]"); -%! legend (labels, "location", "southoutside"); -%! legend ("boxon"); +%! title ('Signals with random offset and uniform noise'); +%! xlabel ('Sample Nr [k]'); ylabel ('Amplitude [V]'); +%! legend (labels, 'location', 'southoutside'); +%! legend ('boxon'); %!demo %! clf; %! labels = {}; -%! colororder = get (gca, "colororder"); +%! colororder = get (gca, 'colororder'); %! for i = 1:5 %! h = plot (1:100, i + rand (100,1)); hold on; -%! set (h, "color", colororder(i,:)); -%! labels = {labels{:}, cstrcat("Signal ", num2str (i))}; -%! endfor +%! set (h, 'color', colororder(i,:)); +%! labels = {labels{:}, cstrcat('Signal ', num2str (i))}; +%! end %! hold off; -%! title ("Signals with random offset and uniform noise"); -%! xlabel ("Sample Nr [k]"); ylabel ("Amplitude [V]"); -%! legend (labels{:}, "location", "southoutside"); -%! legend ("boxon"); +%! title ('Signals with random offset and uniform noise'); +%! xlabel ('Sample Nr [k]'); ylabel ('Amplitude [V]'); +%! legend (labels{:}, 'location', 'southoutside'); +%! legend ('boxon'); %!demo %! clf; @@ -1066,68 +1066,68 @@ %! plot (x, x); %! hold on; %! stem (x, x.^2, 'g'); -%! legend ("linear"); +%! legend ('linear'); %! hold off; %!demo %! clf; %! x = linspace (0, 10); %! plot (x, x, x, x.^2); -%! legend ("linear"); +%! legend ('linear'); %!demo %! clf; %! x = linspace (0, 10); %! plot (x, x, x, x.^2); -%! legend ("linear", "quadratic"); +%! legend ('linear', 'quadratic'); %!demo %! clf; %! rand_2x3_data1 = [0.341447, 0.171220, 0.284370; 0.039773, 0.731725, 0.779382]; %! bar (rand_2x3_data1); %! ylim ([0 1.0]); -%! legend ({"1st Bar", "2nd Bar", "3rd Bar"}); +%! legend ({'1st Bar', '2nd Bar', '3rd Bar'}); %!demo %! clf; %! rand_2x3_data2 = [0.44804, 0.84368, 0.23012; 0.72311, 0.58335, 0.90531]; %! bar (rand_2x3_data2); %! ylim ([0 1.2]); -%! legend ("1st Bar", "2nd Bar", "3rd Bar"); +%! legend ('1st Bar', '2nd Bar', '3rd Bar'); %! legend right; %!demo %! clf; %! x = 0:0.1:7; %! h = plot (x,sin(x), x,cos(x), x,sin(x.^2/10), x,cos(x.^2/10)); -%! title ("Only the sin() objects have keylabels"); -%! legend (h([1, 3]), {"sin(x)", "sin(x^2/10)"}, "location", "southwest"); +%! title ('Only the sin() objects have keylabels'); +%! legend (h([1, 3]), {'sin(x)', 'sin(x^2/10)'}, 'location', 'southwest'); %!demo %! clf; %! x = 0:0.1:10; -%! plot (x, sin(x), ";sin(x);"); +%! plot (x, sin(x), ';sin(x);'); %! hold all; -%! plot (x, cos(x), ";cos(x);"); +%! plot (x, cos(x), ';cos(x);'); %! hold off; %!demo %! clf; %! x = 0:0.1:10; -%! plot (x, sin(x), ";sin(x);"); +%! plot (x, sin(x), ';sin(x);'); %! hold all; -%! plot (x, cos(x), ";cos(x);"); +%! plot (x, cos(x), ';cos(x);'); %! hold off; -%! legend ({"sin(x)", "cos(x)"}, "location", "northeastoutside"); +%! legend ({'sin(x)', 'cos(x)'}, 'location', 'northeastoutside'); %!demo %! clf; %! x = 0:10; %! plot (x, rand (11)); -%! xlabel ("Indices"); -%! ylabel ("Random Values"); -%! title ('Legend "off" should delete the legend'); -%! legend (cellstr (num2str ((1:10)')), "location", "northeastoutside"); +%! xlabel ('Indices'); +%! ylabel ('Random Values'); +%! title ('Legend ''off'' should delete the legend'); +%! legend (cellstr (num2str ((1:10)')), 'location', 'northeastoutside'); %! legend off; %! axis ([0, 10, 0 1]); @@ -1136,52 +1136,52 @@ %! x = (1:5)'; %! subplot (2, 2, 1); %! plot (x, rand (numel (x))); -%! legend (cellstr (num2str (x)), "location", "northwestoutside"); +%! legend (cellstr (num2str (x)), 'location', 'northwestoutside'); %! legend boxon; %! subplot (2, 2, 2); %! plot (x, rand (numel (x))); -%! legend (cellstr (num2str (x)), "location", "northeastoutside"); +%! legend (cellstr (num2str (x)), 'location', 'northeastoutside'); %! legend boxon; %! subplot (2, 2, 3); %! plot (x, rand (numel (x))); -%! legend (cellstr (num2str (x)), "location", "southwestoutside"); +%! legend (cellstr (num2str (x)), 'location', 'southwestoutside'); %! legend boxon; %! subplot (2, 2, 4); %! plot (x, rand (numel (x))); -%! legend (cellstr (num2str (x)), "location", "southeastoutside"); +%! legend (cellstr (num2str (x)), 'location', 'southeastoutside'); %! legend boxon; %!demo %! clf; %! plot (rand (2)); -%! title ("Warn of extra labels"); -%! legend ("Hello", "World", "interpreter", "foobar"); +%! title ('Warn of extra labels'); +%! legend ('Hello', 'World', 'interpreter', 'foobar'); %!demo %! clf; %! plot (rand (2)); -%! title ("Turn off TeX interpreter"); -%! h = legend ("Hello_World", "foo^bar"); -%! set (h, "interpreter", "none"); +%! title ('Turn off TeX interpreter'); +%! h = legend ('Hello_World', 'foo^bar'); +%! set (h, 'interpreter', 'none'); %!demo %! x = 0:10; %! y1 = rand (size (x)); %! y2 = rand (size (x)); %! [ax, h1, h2] = plotyy (x, y1, x, y2); -%! legend ([h1, h2], {"Blue", "Green"}, "location", "south"); +%! legend ([h1, h2], {'Blue', 'Green'}, 'location', 'south'); %!demo %! x = 0:10; %! y1 = rand (size (x)); %! y2 = rand (size (x)); %! [ax, h1, h2] = plotyy (x, y1, x, y2); -%! legend ({"Blue", "Green"}, "location", "south"); +%! legend ({'Blue', 'Green'}, 'location', 'south'); %!demo %! x = 0:10; %! y1 = rand (size (x)); %! y2 = rand (size (x)); %! [ax, h1, h2] = plotyy (x, y1, x, y2); -%! legend ("Blue", "Green", "location", "south"); +%! legend ('Blue', 'Green', 'location', 'south'); diff --git a/scripts/plot/loglog.m b/scripts/plot/loglog.m --- a/scripts/plot/loglog.m +++ b/scripts/plot/loglog.m @@ -77,12 +77,12 @@ %! %! subplot (1,2,1); %! loglog (a, b); -%! xlabel ("loglog (a, b)"); +%! xlabel ('loglog (a, b)'); %! %! subplot (1,2,2); %! loglog (a, abs (b)); -%! set (gca, "ydir", "reverse"); -%! xlabel ("loglog (a, abs (b))"); +%! set (gca, 'ydir', 'reverse'); +%! xlabel ('loglog (a, abs (b))'); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/loglogerr.m b/scripts/plot/loglogerr.m --- a/scripts/plot/loglogerr.m +++ b/scripts/plot/loglogerr.m @@ -67,6 +67,6 @@ %! y = wblpdf (x, 3, 2); %! eyu = 2*rand (size (y)) .* y; %! eyl = 0.5*rand (size (y)) .* y; -%! loglogerr (x, y, eyl, eyu, "#~x-"); +%! loglogerr (x, y, eyl, eyu, '#~x-'); %! xlim (x([1, end])); diff --git a/scripts/plot/pareto.m b/scripts/plot/pareto.m --- a/scripts/plot/pareto.m +++ b/scripts/plot/pareto.m @@ -107,14 +107,14 @@ %!demo %! clf; %! colormap (jet (64)); -%! Cheese = {"Cheddar", "Swiss", "Camembert", "Munster", "Stilton", "Blue"}; +%! Cheese = {'Cheddar', 'Swiss', 'Camembert', 'Munster', 'Stilton', 'Blue'}; %! Sold = [105, 30, 70, 10, 15, 20]; %! pareto (Sold, Cheese); %!demo %! clf; %! % Suppose that we want establish which products makes 80% of turnover. -%! Codes = {"AB4","BD7","CF8","CC5","AD11","BB5","BB3","AD8","DF3","DE7"}; +%! Codes = {'AB4','BD7','CF8','CC5','AD11','BB5','BB3','AD8','DF3','DE7'}; %! Value = [2.35 7.9 2.45 1.1 0.15 13.45 5.4 2.05 0.85 1.65]'; %! SoldUnits = [54723 41114 16939 1576091 168000 687197 120222 168195, ... %! 1084118 55576]'; diff --git a/scripts/plot/patch.m b/scripts/plot/patch.m --- a/scripts/plot/patch.m +++ b/scripts/plot/patch.m @@ -61,7 +61,7 @@ %!demo -%! ## Patches with same number of vertices +%! %% 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; @@ -72,7 +72,7 @@ %! patch ([x1,x2], [y1,y2], 'r'); %!demo -%! ## Unclosed patch +%! %% Unclosed patch %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/16:1)' + 1/32) * 2*pi; @@ -83,7 +83,7 @@ %! patch ([[x1;NaN(8,1)],x2], [[y1;NaN(8,1)],y2], 'r'); %!demo -%! ## Specify vertices and faces separately +%! %% Specify vertices and faces separately %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/16:1)' + 1/32) * 2*pi; @@ -93,10 +93,10 @@ %! y2 = cos (t2); %! vert = [x1, y1; x2, y2]; %! fac = [1:8,NaN(1,8);9:24]; -%! patch ("Faces",fac, "Vertices",vert, "FaceColor","r"); +%! patch ('Faces',fac, 'Vertices',vert, 'FaceColor','r'); %!demo -%! ## Specify vertices and faces separately +%! %% Specify vertices and faces separately %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/16:1)' + 1/32) * 2*pi; @@ -106,10 +106,10 @@ %! y2 = cos (t2); %! vert = [x1, y1; x2, y2]; %! fac = [1:8,NaN(1,8);9:24]; -%! patch ("Faces",fac, "Vertices",vert, "FaceVertexCData", [0, 1, 0; 0, 0, 1]); +%! patch ('Faces',fac, 'Vertices',vert, 'FaceVertexCData', [0, 1, 0; 0, 0, 1]); %!demo -%! ## Property change on multiple patches +%! %% Property change on multiple patches %! clf; %! t1 = (1/16:1/8:1)' * 2*pi; %! t2 = ((1/16:1/8:1)' + 1/32) * 2*pi; @@ -119,7 +119,7 @@ %! y2 = cos (t2); %! h = patch ([x1,x2], [y1,y2], cat (3,[0,0],[1,0],[0,1])); %! pause (1); -%! set (h, "FaceColor", 'r'); +%! set (h, 'FaceColor', 'r'); %!demo %! clf; @@ -132,8 +132,8 @@ %! 2, 3, 5; %! 3, 4, 5; %! 4, 1, 5]; -%! patch ("Vertices", vertices, "Faces", faces, ... -%! "FaceVertexCData", jet (4), "FaceColor", "flat"); +%! patch ('Vertices', vertices, 'Faces', faces, ... +%! 'FaceVertexCData', jet (4), 'FaceColor', 'flat'); %! view (-37.5, 30); %!demo @@ -147,8 +147,8 @@ %! 2, 3, 5; %! 3, 4, 5; %! 4, 1, 5]; -%! patch ("Vertices", vertices, "Faces", faces, ... -%! "FaceVertexCData", jet (5), "FaceColor", "interp"); +%! patch ('Vertices', vertices, 'Faces', faces, ... +%! 'FaceVertexCData', jet (5), 'FaceColor', 'interp'); %! view (-37.5, 30); %!demo @@ -157,12 +157,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))); @@ -173,25 +173,25 @@ %! x = [0 1 1 0]; %! y = [0 0 1 1]; %! subplot (2, 1, 1); -%! title ("Blue horizontal bars: Dark to Light"); -%! patch (x, y + 0, 1, "cdatamapping", "direct"); -%! patch (x, y + 1, 9, "cdatamapping", "direct"); -%! patch (x, y + 2, 17, "cdatamapping", "direct"); +%! title ('Blue horizontal bars: Dark to Light'); +%! patch (x, y + 0, 1, 'cdatamapping', 'direct'); +%! patch (x, y + 1, 9, 'cdatamapping', 'direct'); +%! patch (x, y + 2, 17, 'cdatamapping', 'direct'); %! subplot (2, 1, 2); -%! title ("Blue vertical bars: Dark to Light"); -%! patch (x + 0, y, 1 * ones (size (x)), "cdatamapping", "direct"); -%! patch (x + 1, y, 9 * ones (size (x)), "cdatamapping", "direct"); -%! patch (x + 2, y, 17 * ones (size (x)), "cdatamapping", "direct"); +%! title ('Blue vertical bars: Dark to Light'); +%! patch (x + 0, y, 1 * ones (size (x)), 'cdatamapping', 'direct'); +%! patch (x + 1, y, 9 * ones (size (x)), 'cdatamapping', 'direct'); +%! patch (x + 2, y, 17 * ones (size (x)), 'cdatamapping', 'direct'); %!demo %! clf; %! colormap (jet (64)); %! x = [ 0 0; 1 1; 1 0 ]; %! y = [ 0 0; 0 1; 1 1 ]; -%! p = patch (x, y, "facecolor", "b"); -%! title ("Two blue triangles"); -%! set (p, "cdatamapping", "direct", "facecolor", "flat", "cdata", [1 32]); -%! title ("Direct mapping of colors: Light-Green UL and Blue LR triangles"); +%! p = patch (x, y, 'facecolor', 'b'); +%! title ('Two blue triangles'); +%! set (p, 'cdatamapping', 'direct', 'facecolor', 'flat', 'cdata', [1 32]); +%! title ('Direct mapping of colors: Light-Green UL and Blue LR triangles'); %!demo %! clf; @@ -199,7 +199,7 @@ %! x = [ 0 0; 1 1; 1 0 ]; %! y = [ 0 0; 0 1; 1 1 ]; %! p = patch (x, y, [1 32]); -%! title ("Autoscaling of colors: Red UL and Blue LR triangles"); +%! title ('Autoscaling of colors: Red UL and Blue LR triangles'); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/pbaspect.m b/scripts/plot/pbaspect.m --- a/scripts/plot/pbaspect.m +++ b/scripts/plot/pbaspect.m @@ -95,14 +95,14 @@ %! x = 0:0.01:4; %! plot (x,cos(x), x,sin(x)); %! pbaspect ([1 1 1]); -%! title ("plot box is square"); +%! title ('plot box is square'); %!demo %! clf; %! x = 0:0.01:4;; %! plot (x,cos(x), x,sin(x)); %! pbaspect ([2 1 1]); -%! title ("plot box aspect ratio is 2x1"); +%! title ('plot box aspect ratio is 2x1'); %!demo %! clf; @@ -110,5 +110,5 @@ %! plot (x,cos(x), x,sin(x)); %! daspect ([1 1 1]); %! pbaspect ([2 1 1]); -%! title ("plot box is 2x1, and axes [0 4 -1 1]"); +%! title ('plot box is 2x1, and axes [0 4 -1 1]'); diff --git a/scripts/plot/pie.m b/scripts/plot/pie.m --- a/scripts/plot/pie.m +++ b/scripts/plot/pie.m @@ -74,14 +74,14 @@ %!demo %! clf; -%! pie ([3, 2, 1], [0, 0, 1], {"Cheddar", "Swiss", "Camembert"}); +%! 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"}); +%! 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]); -%! title ("missing slice"); +%! title ('missing slice'); diff --git a/scripts/plot/pie3.m b/scripts/plot/pie3.m --- a/scripts/plot/pie3.m +++ b/scripts/plot/pie3.m @@ -75,14 +75,14 @@ %!demo %! clf; -%! pie3 ([3, 2, 1], [0, 0, 1], {"Cheddar", "Swiss", "Camembert"}); +%! 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"}); +%! 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]); -%! title ("missing slice"); +%! title ('missing slice'); diff --git a/scripts/plot/plot3.m b/scripts/plot/plot3.m --- a/scripts/plot/plot3.m +++ b/scripts/plot/plot3.m @@ -342,6 +342,6 @@ %!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;"); +%! plot3 (cos(2*pi*z), sin(2*pi*z), z, ';helix;'); +%! plot3 (z, exp(2i*pi*z), ';complex sinusoid;'); diff --git a/scripts/plot/plotmatrix.m b/scripts/plot/plotmatrix.m --- a/scripts/plot/plotmatrix.m +++ b/scripts/plot/plotmatrix.m @@ -97,7 +97,7 @@ %!demo %! clf; -%! plotmatrix (randn (100, 3), "g+"); +%! plotmatrix (randn (100, 3), 'g+'); function plotmatrixdelete (h, d, ax) for i = 1 : numel (ax) diff --git a/scripts/plot/plotyy.m b/scripts/plot/plotyy.m --- a/scripts/plot/plotyy.m +++ b/scripts/plot/plotyy.m @@ -233,15 +233,15 @@ %! y1 = sin (x); %! y2 = exp (x - 1); %! ax = plotyy (x,y1, x-1,y2, @plot, @semilogy); -%! xlabel ("X"); -%! ylabel (ax(1), "Axis 1"); -%! ylabel (ax(2), "Axis 2"); +%! xlabel ('X'); +%! ylabel (ax(1), 'Axis 1'); +%! ylabel (ax(2), 'Axis 2'); %! axes (ax(1)); -%! text (0.5, 0.5, "Left Axis", ... -%! "color", [0 0 1], "horizontalalignment", "center"); +%! text (0.5, 0.5, 'Left Axis', ... +%! 'color', [0 0 1], 'horizontalalignment', 'center'); %! axes (ax(2)); -%! text (4.5, 80, "Right Axis", ... -%! "color", [0 0.5 0], "horizontalalignment", "center"); +%! text (4.5, 80, 'Right Axis', ... +%! 'color', [0 0.5 0], 'horizontalalignment', 'center'); %!demo %! clf; @@ -260,9 +260,9 @@ %! clf; %! x = linspace (-1, 1, 201); %! hax = plotyy (x, sin(pi*x), x, cos(pi*x)); -%! ylabel ("Blue on the Left"); -%! ylabel (hax(2), "Green on the Right"); -%! xlabel ("xlabel"); +%! ylabel ('Blue on the Left'); +%! ylabel (hax(2), 'Green on the Right'); +%! xlabel ('xlabel'); function deleteplotyy (h, d, ax2, t2) if (ishandle (ax2) && strcmp (get (ax2, "type"), "axes") diff --git a/scripts/plot/quiver.m b/scripts/plot/quiver.m --- a/scripts/plot/quiver.m +++ b/scripts/plot/quiver.m @@ -86,14 +86,14 @@ %! clf; %! [x,y] = meshgrid (1:2:20); %! h = quiver (x,y, sin (2*pi*x/10), sin (2*pi*y/10)); -%! set (h, "maxheadsize", 0.33); +%! set (h, 'maxheadsize', 0.33); %!demo %! clf; -%! axis ("equal"); +%! axis ('equal'); %! x = linspace (0, 3, 80); %! y = sin (2*pi*x); %! theta = 2*pi*x + pi/2; %! quiver (x, y, sin (theta)/10, cos (theta)/10); -%! hold on; plot (x,y,"r"); hold off; +%! hold on; plot (x,y,'r'); hold off; diff --git a/scripts/plot/quiver3.m b/scripts/plot/quiver3.m --- a/scripts/plot/quiver3.m +++ b/scripts/plot/quiver3.m @@ -103,7 +103,7 @@ %! hold on; %! [u, v, w] = surfnorm (x, y, z / 10); %! h = quiver3 (x, y, z, u, v, w); -%! set (h, "maxheadsize", 0.33); +%! set (h, 'maxheadsize', 0.33); %! hold off; %!demo @@ -113,7 +113,7 @@ %! hold on; %! [u, v, w] = surfnorm (x, y, z / 10); %! h = quiver3 (x, y, z, u, v, w); -%! set (h, "maxheadsize", 0.33); +%! set (h, 'maxheadsize', 0.33); %! hold off; %! shading interp; diff --git a/scripts/plot/rectangle.m b/scripts/plot/rectangle.m --- a/scripts/plot/rectangle.m +++ b/scripts/plot/rectangle.m @@ -207,16 +207,16 @@ %!demo %! clf; %! axis equal; -%! rectangle ("Position", [0.05, 0.05, 0.9, 0.9], "Curvature", [0.5, 0.5]); +%! rectangle ('Position', [0.05, 0.05, 0.9, 0.9], 'Curvature', [0.5, 0.5]); %!demo %! clf; %! axis equal; -%! rectangle ("Position", [0.05, 0.05, 0.9, 0.4], "Curvature", 1.0); +%! rectangle ('Position', [0.05, 0.05, 0.9, 0.4], 'Curvature', 1.0); %!demo %! clf; %! axis equal; -%! h = rectangle ("Position", [0.05, 0.05, 0.9, 0.4], "Curvature", 1.0); -%! set (h, "FaceColor", [0, 1, 0]); +%! h = rectangle ('Position', [0.05, 0.05, 0.9, 0.4], 'Curvature', 1.0); +%! set (h, 'FaceColor', [0, 1, 0]); diff --git a/scripts/plot/refreshdata.m b/scripts/plot/refreshdata.m --- a/scripts/plot/refreshdata.m +++ b/scripts/plot/refreshdata.m @@ -111,10 +111,10 @@ %! clf; %! x = 0:0.1:10; %! y = sin (x); -%! plot (x, y, "ydatasource", "y"); +%! plot (x, y, 'ydatasource', 'y'); %! for i = 1 : 100 %! pause (0.1); %! y = sin (x + 0.1 * i); -%! refreshdata (gcf (), "caller"); -%! endfor +%! refreshdata (gcf (), 'caller'); +%! end diff --git a/scripts/plot/scatter.m b/scripts/plot/scatter.m --- a/scripts/plot/scatter.m +++ b/scripts/plot/scatter.m @@ -85,15 +85,15 @@ %! clf; %! x = randn (100, 1); %! y = randn (100, 1); -%! scatter (x, y, "r"); -%! title ("Scatter plot with red bubbles"); +%! scatter (x, y, 'r'); +%! title ('Scatter plot with red bubbles'); %!demo %! clf; %! x = randn (100, 1); %! y = randn (100, 1); %! scatter (x, y, [], sqrt (x.^2 + y.^2)); -%! title ("Scatter plot with bubble color determined by distance from origin"); +%! title ('Scatter plot with bubble color determined by distance from origin'); %!demo %! clf; @@ -102,9 +102,9 @@ %! x = rand_10x1_data1; %! y = rand_10x1_data2; %! s = 10 - 10*log (x.^2 + y.^2); -%! h = scatter (x, y, s, s, "s", "filled"); -%! title ({"Scatter plot with filled square markers", ... -%! "size and color of markers determined by algorithm"}); +%! h = scatter (x, y, s, s, 's', 'filled'); +%! title ({'Scatter plot with filled square markers', ... +%! 'size and color of markers determined by algorithm'}); %!demo %! clf; @@ -113,7 +113,7 @@ %! x = rand_10x1_data3; %! y = rand_10x1_data4; %! s = 10 - 10*log (x.^2 + y.^2); -%! h = scatter (x, y, [], "r", "s", "filled"); +%! h = scatter (x, y, [], 'r', 's', 'filled'); %!demo %! clf; @@ -122,7 +122,7 @@ %! x = rand_10x1_data5; %! y = rand_10x1_data6; %! s = 10 - 10*log (x.^2 + y.^2); -%! h = scatter (x, y, [], "r", "s"); +%! h = scatter (x, y, [], 'r', 's'); %!demo %! clf; @@ -132,28 +132,28 @@ %! x = rand (n, 1); %! y = rand (n, 1); %! if (m > 1) -%! str = "Three Colors"; +%! str = 'Three Colors'; %! idx = ceil (rand (n, 1) * 3); %! colors = eye (3); %! colors = colors(idx, :); %! else -%! str = "Random Colors"; +%! str = 'Random Colors'; %! colors = rand (n, m); -%! endif +%! end %! if (n == 1) -%! str = sprintf ("%s: 1 point", str); +%! str = sprintf ('%s: 1 point', str); %! elseif (n < 100) -%! str = sprintf ("%s: < 100 points", str); +%! str = sprintf ('%s: < 100 points', str); %! else -%! str = sprintf ("%s: > 100 points", str); -%! endif +%! str = sprintf ('%s: > 100 points', str); +%! end %! subplot (2,3,k); %! k = k + 1; -%! scatter (x, y, 15, colors, "filled"); +%! scatter (x, y, 15, colors, 'filled'); %! axis ([0 1 0 1]); %! title (str); -%! endfor -%! endfor +%! end +%! end %!demo %! clf; @@ -163,26 +163,26 @@ %! x = rand (n, 1); %! y = rand (n, 1); %! if (m > 1) -%! str = "Three Colors"; +%! str = 'Three Colors'; %! idx = ceil (rand (n, 1) * 3); %! colors = eye (3); %! colors = colors(idx, :); %! else -%! str = "Random Colors"; +%! str = 'Random Colors'; %! colors = rand (n, m); -%! endif +%! end %! if (n == 1) -%! str = sprintf ("%s: 1 point", str); +%! str = sprintf ('%s: 1 point', str); %! elseif (n < 100) -%! str = sprintf ("%s: < 100 points", str); +%! str = sprintf ('%s: < 100 points', str); %! else -%! str = sprintf ("%s: > 100 points", str); -%! endif +%! str = sprintf ('%s: > 100 points', str); +%! end %! subplot (2,3,k); %! k = k + 1; %! scatter (x, y, 15, colors); %! axis ([0 1 0 1]); %! title (str); -%! endfor -%! endfor +%! end +%! end diff --git a/scripts/plot/scatter3.m b/scripts/plot/scatter3.m --- a/scripts/plot/scatter3.m +++ b/scripts/plot/scatter3.m @@ -87,24 +87,24 @@ %! clf; %! [x, y, z] = peaks (20); %! scatter3 (x(:), y(:), z(:), [], z(:)); -%! ## Default scatter3 with constant size bubbles and color determined by Z +%! %% Default scatter3 with constant size bubbles and color determined by Z %!demo %! clf; %! x = rand (20,1); y = rand (20,1); z = rand (20,1); -%! scatter3 (x(:), y(:), z(:), 10, z(:), "s"); -%! ## scatter3 using a square marker of size 10 and color determined by Z +%! scatter3 (x(:), y(:), z(:), 10, z(:), 's'); +%! %% scatter3 using a square marker of size 10 and color determined by Z %!demo %! clf; %! x = rand (20,1); y = rand (20,1); z = rand (20,1); -%! scatter3 (x(:), y(:), z(:), 20*z(:), [], "s"); -%! ## scatter3 using a square marker whose size is determined by Z +%! scatter3 (x(:), y(:), z(:), 20*z(:), [], 's'); +%! %% scatter3 using a square marker whose size is determined by Z %!demo %! clf; %! x = rand (20,1); y = rand (20,1); z = rand (20,1); -%! scatter3 (x(:), y(:), z(:), 20*z(:), z(:), "s"); -%! ## scatter3 using a square marker. -%! ## Size and color of marker are determined by Z +%! scatter3 (x(:), y(:), z(:), 20*z(:), z(:), 's'); +%! %% scatter3 using a square marker. +%! %% Size and color of marker are determined by Z diff --git a/scripts/plot/semilogx.m b/scripts/plot/semilogx.m --- a/scripts/plot/semilogx.m +++ b/scripts/plot/semilogx.m @@ -76,11 +76,11 @@ %! %! subplot (1,2,1); %! semilogx (x, y); -%! xlabel ("semilogx (x, y)"); +%! xlabel ('semilogx (x, y)'); %! %! subplot (1,2,2); %! semilogx (-x, y); -%! xlabel ("semilogx (-x, y)"); +%! xlabel ('semilogx (-x, y)'); %!demo %! clf; @@ -89,13 +89,13 @@ %! %! subplot (1,2,1); %! semilogx (x, y); -%! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition"); -%! xlabel ({"semilogx (x, y)", "xdir = reversed"}); +%! set (gca, 'xdir', 'reverse', 'activepositionproperty', 'outerposition'); +%! xlabel ({'semilogx (x, y)', 'xdir = reversed'}); %! %! subplot (1,2,2); %! semilogx (-x, y); -%! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition"); -%! xlabel ({"semilogx (-x, y)", "xdir = reversed"}); +%! set (gca, 'xdir', 'reverse', 'activepositionproperty', 'outerposition'); +%! xlabel ({'semilogx (-x, y)', 'xdir = reversed'}); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/semilogxerr.m b/scripts/plot/semilogxerr.m --- a/scripts/plot/semilogxerr.m +++ b/scripts/plot/semilogxerr.m @@ -66,6 +66,6 @@ %! x = exp (log(0.01):0.2:log(10)); %! y = wblpdf (x, 2, 2); %! ey = 0.5*rand (size (y)) .* y; -%! semilogxerr (x, y, ey, "#~x-"); +%! semilogxerr (x, y, ey, '#~x-'); %! xlim (x([1, end])); diff --git a/scripts/plot/semilogy.m b/scripts/plot/semilogy.m --- a/scripts/plot/semilogy.m +++ b/scripts/plot/semilogy.m @@ -77,11 +77,11 @@ %! %! subplot (2, 1, 1); %! semilogy (x, y); -%! ylabel ("semilogy (x, y)"); +%! ylabel ('semilogy (x, y)'); %! %! subplot (2, 1, 2); %! semilogy (x, -y); -%! ylabel ("semilogy (x, -y)"); +%! ylabel ('semilogy (x, -y)'); %!demo %! clf; @@ -90,13 +90,13 @@ %! %! subplot (2, 1, 1); %! semilogy (x, y); -%! set (gca, "ydir", "reverse", "activepositionproperty", "outerposition"); -%! ylabel ({"semilogy (x, y)", "ydir = reversed"}); +%! set (gca, 'ydir', 'reverse', 'activepositionproperty', 'outerposition'); +%! ylabel ({'semilogy (x, y)', 'ydir = reversed'}); %! %! subplot (2, 1, 2); %! semilogy (x, -y); -%! set (gca, "ydir", "reverse", "activepositionproperty", "outerposition"); -%! ylabel ({"semilogy (x, -y)", "ydir = reversed"}); +%! set (gca, 'ydir', 'reverse', 'activepositionproperty', 'outerposition'); +%! ylabel ({'semilogy (x, -y)', 'ydir = reversed'}); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/semilogyerr.m b/scripts/plot/semilogyerr.m --- a/scripts/plot/semilogyerr.m +++ b/scripts/plot/semilogyerr.m @@ -67,6 +67,6 @@ %! y = wblpdf (x, 4, 2); %! eyu = rand (size (y)); %! eyl = 1.0 - 1./(1+eyu); -%! semilogyerr (x, y, eyl.*y, eyu.*y, "~-d"); +%! semilogyerr (x, y, eyl.*y, eyu.*y, '~-d'); %! xlim ([0 10]); diff --git a/scripts/plot/shading.m b/scripts/plot/shading.m --- a/scripts/plot/shading.m +++ b/scripts/plot/shading.m @@ -79,35 +79,35 @@ %! colormap (jet (64)); %! sombrero (); %! shading faceted; -%! title ('shading "faceted"'); +%! title ('shading ''faceted'''); %!demo %! clf; %! sombrero (); %! shading flat; -%! title ('shading "flat"'); +%! title ('shading ''flat'''); %!demo %! clf; %! sombrero (); %! shading interp; -%! title ('shading "interp"'); +%! title ('shading ''interp'''); %!demo %! clf; %! pcolor (peaks ()); %! shading faceted; -%! title ('shading "faceted"'); +%! title ('shading ''faceted'''); %!demo %! clf; %! pcolor (peaks ()); %! shading flat; -%! title ('shading "flat"'); +%! title ('shading ''flat'''); %!demo %! clf; %! pcolor (peaks ()); %! shading interp; -%! title ('shading "interp"'); +%! title ('shading ''interp'''); diff --git a/scripts/plot/stem.m b/scripts/plot/stem.m --- a/scripts/plot/stem.m +++ b/scripts/plot/stem.m @@ -102,31 +102,31 @@ %! clf; %! x = 1:10; %! y = 2*x; -%! h = stem (x, y, "r"); +%! h = stem (x, y, 'r'); %!demo %! clf; %! x = 1:10; %! y = 2*x; -%! h = stem (x, y, "-.k"); +%! h = stem (x, y, '-.k'); %!demo %! clf; %! x = 1:10; %! y = 2*x; -%! h = stem (x, y, "-.k."); +%! h = stem (x, y, '-.k.'); %!demo %! clf; %! x = 1:10; %! y = 2*x; -%! h = stem (x, y, "filled"); +%! h = stem (x, y, 'filled'); %!demo %! clf; %! x = (0 : 10)'; %! y = [sin(x), cos(x)]; %! h = stem (x, y); -%! set (h(2), "color", "g"); -%! set (h(1), "basevalue", -1) +%! set (h(2), 'color', 'g'); +%! set (h(1), 'basevalue', -1) diff --git a/scripts/plot/subplot.m b/scripts/plot/subplot.m --- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -331,35 +331,35 @@ %! clf; %! r = 3; %! c = 3; -%! fmt = {"horizontalalignment", "center", "verticalalignment", "middle"}; +%! fmt = {'horizontalalignment', 'center', 'verticalalignment', 'middle'}; %! for n = 1 : r*c %! subplot (r, c, n); -%! xlabel (sprintf ("xlabel #%d", n)); -%! ylabel (sprintf ("ylabel #%d", n)); -%! title (sprintf ("title #%d", n)); -%! text (0.5, 0.5, sprintf("subplot(%d,%d,%d)", r, c, n), fmt{:}); +%! xlabel (sprintf ('xlabel #%d', n)); +%! ylabel (sprintf ('ylabel #%d', n)); +%! title (sprintf ('title #%d', n)); +%! text (0.5, 0.5, sprintf('subplot(%d,%d,%d)', r, c, n), fmt{:}); %! axis ([0 1 0 1]); -%! endfor +%! end %! subplot (r, c, 1:3); -%! xlabel (sprintf ("xlabel #%d:%d", 1, 3)); -%! ylabel (sprintf ("ylabel #%d:%d", 1, 3)); -%! title (sprintf ("title #%d:%d", 1, 3)); -%! text (0.5, 0.5, sprintf("subplot(%d,%d,%d:%d)", r, c, 1, 3), fmt{:}); +%! xlabel (sprintf ('xlabel #%d:%d', 1, 3)); +%! ylabel (sprintf ('ylabel #%d:%d', 1, 3)); +%! title (sprintf ('title #%d:%d', 1, 3)); +%! text (0.5, 0.5, sprintf('subplot(%d,%d,%d:%d)', r, c, 1, 3), fmt{:}); %! axis ([0 1 0 1]); %!demo %! clf; %! x = 0:1; %! for n = 1:4 -%! subplot (2, 2, n, "align"); +%! subplot (2, 2, n, 'align'); %! plot (x, x); -%! xlabel (sprintf ("xlabel (2,2,%d)", n)); -%! ylabel (sprintf ("ylabel (2,2,%d)", n)); -%! title (sprintf ("title (2,2,%d)", n)); -%! endfor -%! subplot (1, 2, 1, "align"); +%! xlabel (sprintf ('xlabel (2,2,%d)', n)); +%! ylabel (sprintf ('ylabel (2,2,%d)', n)); +%! title (sprintf ('title (2,2,%d)', n)); +%! end +%! subplot (1, 2, 1, 'align'); %! plot (x, x); -%! xlabel ("xlabel (1,2,1)"); -%! ylabel ("ylabel (1,2,1)"); -%! title ("title (1,2,1)"); +%! xlabel ('xlabel (1,2,1)'); +%! ylabel ('ylabel (1,2,1)'); +%! title ('title (1,2,1)'); diff --git a/scripts/plot/text.m b/scripts/plot/text.m --- a/scripts/plot/text.m +++ b/scripts/plot/text.m @@ -129,94 +129,94 @@ %!demo %! clf; -%! ha = {"left", "center", "right"}; -%! va = {"bottom", "middle", "top"}; +%! ha = {'left', 'center', 'right'}; +%! va = {'bottom', 'middle', 'top'}; %! x = y = [0.25 0.5 0.75]; %! for t = 0:30:359; %! for nh = 1:numel(ha) %! for nv = 1:numel(va) -%! text (x(nh), y(nv), "Hello World", ... -%! "rotation", t, ... -%! "horizontalalignment", ha{nh}, ... -%! "verticalalignment", va{nv}); -%! endfor -%! endfor -%! endfor -%! set (gca, "xtick", [0.25, 0.5, 0.75], ... -%! "xticklabel", ha, ... -%! "ytick", [0.25, 0.5, 0.75], ... -%! "yticklabel", va); +%! text (x(nh), y(nv), 'Hello World', ... +%! 'rotation', t, ... +%! 'horizontalalignment', ha{nh}, ... +%! 'verticalalignment', va{nv}); +%! end +%! end +%! end +%! set (gca, 'xtick', [0.25, 0.5, 0.75], ... +%! 'xticklabel', ha, ... +%! 'ytick', [0.25, 0.5, 0.75], ... +%! 'yticklabel', va); %! axis ([0 1 0 1]); -%! xlabel ("horizontal alignment"); -%! ylabel ("vertical alignment"); -%! title ("text alignment and rotation (0:30:360 degrees)"); +%! xlabel ('horizontal alignment'); +%! ylabel ('vertical alignment'); +%! title ('text alignment and rotation (0:30:360 degrees)'); %!demo %! clf; -%! h = mesh (peaks, "edgecolor", 0.7 * [1 1 1], ... -%! "facecolor", "none", ... -%! "facealpha", 0); +%! h = mesh (peaks, 'edgecolor', 0.7 * [1 1 1], ... +%! 'facecolor', 'none', ... +%! 'facealpha', 0); %! for t = 0:45:359; -%! text (25, 25, 0, "Vertical Alignment = Bottom", ... -%! "rotation", t, ... -%! "horizontalalignment", "left", ... -%! "verticalalignment", "bottom"); -%! endfor +%! text (25, 25, 0, 'Vertical Alignment = Bottom', ... +%! 'rotation', t, ... +%! 'horizontalalignment', 'left', ... +%! 'verticalalignment', 'bottom'); +%! end %! caxis ([-100 100]); -%! title ("Vertically Aligned at Bottom"); +%! title ('Vertically Aligned at Bottom'); %!demo %! clf; %! axis ([0 8 0 8]); -%! title (["1st title";"2nd title"]); -%! xlabel (["1st xlabel";"2nd xlabel"]); -%! ylabel (["1st ylabel";"2nd ylabel"]); -%! text (4, 4, {"Hello", "World"}, ... -%! "horizontalalignment", "center", ... -%! "verticalalignment", "middle"); +%! title (['1st title';'2nd title']); +%! xlabel (['1st xlabel';'2nd xlabel']); +%! ylabel (['1st ylabel';'2nd ylabel']); +%! text (4, 4, {'Hello', 'World'}, ... +%! 'horizontalalignment', 'center', ... +%! 'verticalalignment', 'middle'); %! grid on; %!demo %! clf; -%! h = mesh (peaks (), "edgecolor", 0.7 * [1 1 1], ... -%! "facecolor", "none", ... -%! "facealpha", 0); -%! title (["1st title";"2nd title"]); -%! xlabel (["1st xlabel";"2nd xlabel"]); -%! ylabel (["1st ylabel";"2nd ylabel"]); -%! zlabel (["1st zlabel";"2nd zlabel"]); -%! text (0, 0, 5, {"Hello", "World"}, ... -%! "horizontalalignment", "center", ... -%! "verticalalignment", "middle"); +%! h = mesh (peaks (), 'edgecolor', 0.7 * [1 1 1], ... +%! 'facecolor', 'none', ... +%! 'facealpha', 0); +%! title (['1st title';'2nd title']); +%! xlabel (['1st xlabel';'2nd xlabel']); +%! ylabel (['1st ylabel';'2nd ylabel']); +%! zlabel (['1st zlabel';'2nd zlabel']); +%! text (0, 0, 5, {'Hello', 'World'}, ... +%! 'horizontalalignment', 'center', ... +%! 'verticalalignment', 'middle'); %! hold on; -%! plot3 (0, 0, 5, "+k"); +%! plot3 (0, 0, 5, '+k'); %!demo %! clf; -%! h = text (0.5, 0.3, "char"); -%! assert ("char", class (get (h, "string"))); -%! h = text (0.5, 0.4, ["char row 1"; "char row 2"]); -%! assert ("char", class (get (h, "string"))); -%! h = text (0.5, 0.6, {"cell2str (1,1)", "cell2str (1,2)"; "cell2str (2,1)", "cell2str (2,2)"}); -%! assert ("cell", class (get (h, "string"))); -%! h = text (0.5, 0.8, "foobar"); -%! set (h, "string", 1:3); -%! h = text ([0.1, 0.1], [0.3, 0.4], "one string & two objects"); -%! assert ("char", class (get (h(1), "string"))); -%! assert ("char", class (get (h(2), "string"))); -%! h = text ([0.1, 0.1], [0.5, 0.6], {"one cellstr & two objects"}); -%! assert ("cell", class (get (h(1), "string"))); -%! assert ("cell", class (get (h(2), "string"))); -%! h = text ([0.1, 0.1], [0.7, 0.8], {"cellstr 1 object 1", "cellstr 2 object 2"}); -%! assert ("char", class (get (h(1), "string"))); -%! assert ("char", class (get (h(2), "string"))); -%! h = text ([0.1, 0.1], [0.1, 0.2], ["1st string & 1st object"; "2nd string & 2nd object"]); -%! assert ("char", class (get (h(1), "string"))); -%! assert ("char", class (get (h(2), "string"))); -%! h = text (0.7, 0.6, "single string"); -%! assert ("char", class (get (h, "string"))); -%! h = text (0.7, 0.5, {"single cell-string"}); -%! assert ("cell", class (get (h, "string"))); +%! h = text (0.5, 0.3, 'char'); +%! assert ('char', class (get (h, 'string'))); +%! h = text (0.5, 0.4, ['char row 1'; 'char row 2']); +%! assert ('char', class (get (h, 'string'))); +%! h = text (0.5, 0.6, {'cell2str (1,1)', 'cell2str (1,2)'; 'cell2str (2,1)', 'cell2str (2,2)'}); +%! assert ('cell', class (get (h, 'string'))); +%! h = text (0.5, 0.8, 'foobar'); +%! set (h, 'string', 1:3); +%! h = text ([0.1, 0.1], [0.3, 0.4], 'one string & two objects'); +%! assert ('char', class (get (h(1), 'string'))); +%! assert ('char', class (get (h(2), 'string'))); +%! h = text ([0.1, 0.1], [0.5, 0.6], {'one cellstr & two objects'}); +%! assert ('cell', class (get (h(1), 'string'))); +%! assert ('cell', class (get (h(2), 'string'))); +%! h = text ([0.1, 0.1], [0.7, 0.8], {'cellstr 1 object 1', 'cellstr 2 object 2'}); +%! assert ('char', class (get (h(1), 'string'))); +%! assert ('char', class (get (h(2), 'string'))); +%! h = text ([0.1, 0.1], [0.1, 0.2], ['1st string & 1st object'; '2nd string & 2nd object']); +%! assert ('char', class (get (h(1), 'string'))); +%! assert ('char', class (get (h(2), 'string'))); +%! h = text (0.7, 0.6, 'single string'); +%! assert ('char', class (get (h, 'string'))); +%! h = text (0.7, 0.5, {'single cell-string'}); +%! assert ('cell', class (get (h, 'string'))); %! xlabel (1:2); %! ylabel (1:2); %! title (1:2); diff --git a/scripts/plot/title.m b/scripts/plot/title.m --- a/scripts/plot/title.m +++ b/scripts/plot/title.m @@ -48,16 +48,16 @@ %!demo %! clf; %! ax = axes (); -%! xl = get (ax,"title"); -%! title ("Testing title"); -%! assert (get (xl, "string"), "Testing title"); +%! xl = get (ax,'title'); +%! title ('Testing title'); +%! assert (get (xl, 'string'), 'Testing title'); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); -%! xl = get (gca (), "title"); -%! title ("Testing title"); -%! assert (get (xl, "string"), "Testing title"); +%! xl = get (gca (), 'title'); +%! title ('Testing title'); +%! assert (get (xl, 'string'), 'Testing title'); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/trimesh.m b/scripts/plot/trimesh.m --- a/scripts/plot/trimesh.m +++ b/scripts/plot/trimesh.m @@ -57,9 +57,9 @@ %!demo %! clf; -%! old_state = rand ("state"); -%! restore_state = onCleanup (@() rand ("state", old_state)); -%! rand ("state", 10); +%! 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); diff --git a/scripts/plot/triplot.m b/scripts/plot/triplot.m --- a/scripts/plot/triplot.m +++ b/scripts/plot/triplot.m @@ -49,9 +49,9 @@ %!demo %! clf; -%! old_state = rand ("state"); -%! restore_state = onCleanup (@() rand ("state", old_state)); -%! rand ("state", 2); +%! old_state = rand ('state'); +%! restore_state = onCleanup (@() rand ('state', old_state)); +%! rand ('state', 2); %! N = 20; %! x = rand (N, 1); %! y = rand (N, 1); diff --git a/scripts/plot/trisurf.m b/scripts/plot/trisurf.m --- a/scripts/plot/trisurf.m +++ b/scripts/plot/trisurf.m @@ -78,10 +78,10 @@ %! [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; @@ -89,16 +89,16 @@ %! [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'))); %!demo %! clf; -%! old_state = rand ("state"); -%! restore_state = onCleanup (@() rand ("state", old_state)); -%! rand ("state", 10); +%! 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); @@ -120,7 +120,7 @@ %! 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; @@ -128,5 +128,5 @@ %! y = rand (100, 1); %! z = x.^2 + y.^2; %! tri = delaunay (x, y); -%! trisurf (tri, x, y, z, "facecolor", "interp", "edgecolor", "k"); +%! trisurf (tri, x, y, z, 'facecolor', 'interp', 'edgecolor', 'k'); diff --git a/scripts/plot/uigetdir.m b/scripts/plot/uigetdir.m --- a/scripts/plot/uigetdir.m +++ b/scripts/plot/uigetdir.m @@ -60,7 +60,7 @@ %!demo -%! uigetdir (pwd, "Select Directory"); +%! uigetdir (pwd, 'Select Directory'); ## Remove from test statistics. No real tests possible. %!assert (1) diff --git a/scripts/plot/uigetfile.m b/scripts/plot/uigetfile.m --- a/scripts/plot/uigetfile.m +++ b/scripts/plot/uigetfile.m @@ -188,7 +188,7 @@ %!demo -%! uigetfile ({"*.gif;*.png;*.jpg", "Supported Picture Formats"}); +%! uigetfile ({'*.gif;*.png;*.jpg', 'Supported Picture Formats'}); ## Remove from test statistics. No real tests possible. %!assert (1); diff --git a/scripts/plot/uimenu.m b/scripts/plot/uimenu.m --- a/scripts/plot/uimenu.m +++ b/scripts/plot/uimenu.m @@ -94,11 +94,11 @@ %! clf; %! surfl (peaks); %! colormap (copper (64)); -%! shading ("interp"); -%! f = uimenu ("label", "&File", "accelerator", "f"); -%! e = uimenu ("label", "&Edit", "accelerator", "e"); -%! uimenu (f, "label", "Close", "accelerator", "q", "callback", "close (gcf)"); -%! uimenu (e, "label", "Toggle &Grid", "accelerator", "g", "callback", "grid (gca)"); +%! shading ('interp'); +%! f = uimenu ('label', '&File', 'accelerator', 'f'); +%! e = uimenu ('label', '&Edit', 'accelerator', 'e'); +%! uimenu (f, 'label', 'Close', 'accelerator', 'q', 'callback', 'close (gcf)'); +%! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)'); %!testif HAVE_FLTK %! toolkit = graphics_toolkit (); diff --git a/scripts/plot/uiputfile.m b/scripts/plot/uiputfile.m --- a/scripts/plot/uiputfile.m +++ b/scripts/plot/uiputfile.m @@ -122,7 +122,7 @@ %!demo -%! uiputfile ({"*.gif;*.png;*.jpg", "Supported Picture Formats"}); +%! uiputfile ({'*.gif;*.png;*.jpg', 'Supported Picture Formats'}); ## Remove from test statistics. No real tests possible. %!assert (1) diff --git a/scripts/plot/waitbar.m b/scripts/plot/waitbar.m --- a/scripts/plot/waitbar.m +++ b/scripts/plot/waitbar.m @@ -92,8 +92,12 @@ if (ischar (msg) || iscellstr (msg)) th = get (ax, "title"); curr_msg = get (th, "string"); + ## graphics handles always store data as column vectors + if (iscellstr (msg)) + msg = msg(:); + endif cmp = strcmp (msg, curr_msg); - if (all (cmp(:))) + if (! all (cmp(:))) set (th, "string", msg); endif endif @@ -132,46 +136,46 @@ %!demo -%! h = waitbar (0, "0.00%"); +%! h = waitbar (0, '0.00%'); %! for i = 0:0.01:1 -%! waitbar (i, h, sprintf ("%.2f%%", 100*i)); -%! endfor +%! waitbar (i, h, sprintf ('%.2f%%', 100*i)); +%! end %! close (h); %!demo -%! h = waitbar (0, "please wait..."); +%! h = waitbar (0, 'please wait...'); %! for i = 0:0.01:0.6 %! waitbar (i); -%! endfor +%! end %! i = 0.3; -%! waitbar (i, h, "don't you hate taking a step backward?"); +%! waitbar (i, h, 'don''t you hate taking a step backward?'); %! pause (0.5); %! for i = i:0.005:0.7 %! waitbar (i, h); -%! endfor -%! waitbar (i, h, "or stalling?"); +%! end +%! waitbar (i, h, 'or stalling?'); %! pause (1); %! for i = i:0.003:0.8 -%! waitbar (i, h, "just a little longer now"); -%! endfor +%! waitbar (i, h, 'just a little longer now'); +%! end %! for i = i:0.001:1 -%! waitbar (i, h, "please don't be impatient"); -%! endfor +%! waitbar (i, h, 'please don''t be impatient'); +%! end %! close (h); %!demo -%! h1 = waitbar (0, "Waitbar #1"); -%! h2 = waitbar (0, "Waitbar #2"); -%! h2pos = get (h2, "position"); +%! h1 = waitbar (0, 'Waitbar #1'); +%! h2 = waitbar (0, 'Waitbar #2'); +%! h2pos = get (h2, 'position'); %! h2pos(1) += (h2pos(3) + 50); -%! set (h2, "position", h2pos); +%! set (h2, 'position', h2pos); %! pause (0.5); %! for i = 1:4 %! waitbar (i/4, h1); %! pause (0.5); %! waitbar (i/4, h2); %! pause (0.5); -%! endfor +%! end %! pause (0.5); %! close (h1); %! close (h2); diff --git a/scripts/plot/xlim.m b/scripts/plot/xlim.m --- a/scripts/plot/xlim.m +++ b/scripts/plot/xlim.m @@ -54,30 +54,29 @@ %! clf; %! line (); %! xlim ([0.2, 0.8]); -%! title ("xlim is [0.2, 0.8]"); +%! title ('xlim is [0.2, 0.8]'); %! assert (xlim (), [0.2, 0.8]); %!demo %! clf; %! line (); -%! xlim ("auto"); -%! title ("xlim is auto"); -%! assert (xlim ("mode"), "auto"); +%! xlim ('auto'); +%! title ('xlim is auto'); +%! assert (xlim ('mode'), 'auto'); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); %! xlim ([0.2, 0.8]); -%! title ("xlim is [0.2, 0.8]"); +%! title ('xlim is [0.2, 0.8]'); %! assert (xlim (), [0.2, 0.8]); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); -%! xlim ("auto"); -%! title ("xlim is auto"); -%! assert (xlim ("mode"), "auto"); - +%! xlim ('auto'); +%! title ('xlim is auto'); +%! assert (xlim ('mode'), 'auto'); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/ylim.m b/scripts/plot/ylim.m --- a/scripts/plot/ylim.m +++ b/scripts/plot/ylim.m @@ -50,29 +50,29 @@ %! clf; %! line (); %! ylim ([0.2, 0.8]); -%! title ("ylim is [0.2, 0.8]"); +%! title ('ylim is [0.2, 0.8]'); %! assert (ylim (), [0.2, 0.8]); %!demo %! clf; %! line (); -%! ylim ("auto"); -%! title ("ylim is auto"); -%! assert (ylim ("mode"), "auto"); +%! ylim ('auto'); +%! title ('ylim is auto'); +%! assert (ylim ('mode'), 'auto'); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); %! ylim ([0.2, 0.8]); -%! title ("ylim is [0.2, 0.8]"); +%! title ('ylim is [0.2, 0.8]'); %! assert (ylim (), [0.2, 0.8]); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); -%! ylim ("auto"); -%! title ("ylim is auto"); -%! assert (ylim ("mode"), "auto"); +%! ylim ('auto'); +%! title ('ylim is auto'); +%! assert (ylim ('mode'), 'auto'); %!test %! hf = figure ("visible", "off"); diff --git a/scripts/plot/zlim.m b/scripts/plot/zlim.m --- a/scripts/plot/zlim.m +++ b/scripts/plot/zlim.m @@ -50,29 +50,29 @@ %! clf; %! line (); %! zlim ([0.2, 0.8]); -%! title ("zlim is [0.2, 0.8]"); +%! title ('zlim is [0.2, 0.8]'); %! assert (zlim (), [0.2, 0.8]); %!demo %! clf; %! line (); -%! zlim ("auto"); -%! title ("zlim is auto"); -%! assert (zlim ("mode"), "auto"); +%! zlim ('auto'); +%! title ('zlim is auto'); +%! assert (zlim ('mode'), 'auto'); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); %! zlim ([0.2, 0.8]); -%! title ("zlim is [0.2, 0.8]"); +%! title ('zlim is [0.2, 0.8]'); %! assert (zlim (), [0.2, 0.8]); %!demo %! clf; %! plot3 ([0,1], [0,1], [0,1]); -%! zlim ("auto"); -%! title ("zlim is auto"); -%! assert (zlim ("mode"), "auto"); +%! zlim ('auto'); +%! title ('zlim is auto'); +%! assert (zlim ('mode'), 'auto'); %!test %! hf = figure ("visible", "off");