# HG changeset patch # User jwe # Date 1161706161 0 # Node ID b15a143c5607804b7088f81df4a3a497610bbcde # Parent eaeff5ddfae52ec828c95c62af03bdec2e75774a [project @ 2006-10-24 16:09:21 by jwe] diff --git a/scripts/plot/__plt3__.m b/scripts/plot/__plt3__.m --- a/scripts/plot/__plt3__.m +++ b/scripts/plot/__plt3__.m @@ -38,6 +38,8 @@ if (nargin < 2) have_usingstr = false; usingstr = ""; + else + have_usingstr = true; endif if (nargin < 3) fmtstr = ""; diff --git a/scripts/plot/mesh.m b/scripts/plot/mesh.m --- a/scripts/plot/mesh.m +++ b/scripts/plot/mesh.m @@ -46,7 +46,7 @@ __gnuplot_set__ noparametric; __gnuplot_raw__ ("set nologscale;\n"); __gnuplot_raw__ ("set view 60, 30, 1, ;\n"); - __plt3__ (z'); + __plt3__ (z', ""); else error ("mesh: argument must be a matrix"); endif @@ -107,7 +107,7 @@ __gnuplot_raw__ ("set nologscale;\n"); __gnuplot_set__ parametric; __gnuplot_raw__ ("set view 60, 30, 1, 1;\n"); - __plt3__ (zz); + __plt3__ (zz, ""); unwind_protect_cleanup __gnuplot_set__ noparametric; end_unwind_protect diff --git a/scripts/plot/sombrero.m b/scripts/plot/sombrero.m --- a/scripts/plot/sombrero.m +++ b/scripts/plot/sombrero.m @@ -19,13 +19,13 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} sombrero (@var{n}) -## ## Draw a `sombrero' in three dimensions using @var{n} grid lines. The ## function plotted is ## ## @example ## z = sin (sqrt (x^2 + y^2)) / (sqrt (x^2 + y^2)) ## @end example +## @seealso{mesh, meshgrid} ## @end deftypefn ## Author: jwe @@ -38,13 +38,17 @@ if (nargin < 2) if (n > 1) - x = y = linspace (-8, 8, n)'; - [xx, yy] = meshgrid (x, y); + tx = ty = linspace (-8, 8, n)'; + [xx, yy] = meshgrid (tx, ty); r = sqrt (xx .^ 2 + yy .^ 2) + eps; - z = sin (r) ./ r; + tz = sin (r) ./ r; if (nargout == 0) - mesh (x, y, z); - end + mesh (tx, ty, tz); + else + x = tx; + y = ty; + z = tz; + endif else error ("sombrero: number of grid lines must be greater than 1"); endif