# HG changeset patch # User David Bateman # Date 1202470239 -3600 # Node ID dfcaf7ed48e3115044bdfb19eb23fcc55ca408be # Parent da8e4aa06134b1a49dc595a428fcbd731de193e4 Allow linewidth to be specified for contours diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -2,6 +2,12 @@ * audio/wavread.m: Limit data read to end of data chunk. +2008-02-08 David Bateman * signal/arch_rnd.m: Correctly index E and Y vectors. diff --git a/scripts/plot/__contour__.m b/scripts/plot/__contour__.m --- a/scripts/plot/__contour__.m +++ b/scripts/plot/__contour__.m @@ -28,7 +28,7 @@ for i = 3 : nargin arg = varargin {i}; if ((ischar (arg) || iscell (arg))) - [linespec, valid] = __pltopt__ ("quiver", arg, false); + [linespec, valid] = __pltopt__ ("contour", arg, false); if (isempty (linespec.color)) linespec.color = "flat"; endif @@ -40,15 +40,24 @@ endif endfor + opts = {}; + i = 3; + while (i < length (varargin)) + if (ischar (varargin {i})) + opts{end+1} = varargin{i}; + varargin(i) = []; + opts{end+1} = varargin{i}; + varargin(i) = []; + else + i++; + endif + endwhile + if (ischar (z)) if (strcmp (z, "none")) z = NaN; elseif (strcmp (z, "base")) - if (nargin < 3) - z = varargin{1}; - else - z = varargin{3}; - endif + z = varargin{3}; z = 2 * (min (z(:)) - max (z(:))); elseif (! strcmp (z, "level")) error ("unrecognized z argument"); @@ -73,15 +82,15 @@ if (isnan (z)) h = [h; patch(ax, p(1,:), p(2,:), "facecolor", "none", "edgecolor", linespec.color, "linestyle", - linespec.linestyle, "cdata", clev)]; + linespec.linestyle, "cdata", clev, opts{:})]; elseif (!ischar(z)) h = [h; patch(ax, p(1,:), p(2,:), z * ones (1, columns (p)), "facecolor", "none", "edgecolor", linespec.color, - "linestyle", linespec.linestyle, "cdata", clev)]; + "linestyle", linespec.linestyle, "cdata", clev, opts{:})]; else h = [h; patch(ax, p(1,:), p(2,:), clev * ones (1, columns (p)), "facecolor", "none", "edgecolor", linespec.color, - "linestyle", linespec.linestyle, "cdata", clev)]; + "linestyle", linespec.linestyle, "cdata", clev, opts{:})]; endif i1 += clen+1; endwhile diff --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -694,6 +694,16 @@ lt = ""; endif + if (isfield (obj, "linewidth")) + if (have_newer_gnuplot) + lw = sprintf("linewidth %f", obj.linewidth); + else + lw = sprintf("lw %f", obj.linewidth); + endif + else + lw = ""; + endif + if (isfield (obj, "marker")) if (isfield (obj, "marker")) switch (obj.marker) @@ -768,8 +778,9 @@ colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", round (255*color)); endif - withclause{data_idx} = sprintf ("with %s %s %s %s %s", - style, pt, lt, ps, colorspec); + withclause{data_idx} = sprintf ("with %s %s %s %s %s %s", + style, lw, pt, lt, ps, + colorspec); else if (isequal (color, [0,0,0])) typ = -1; @@ -790,8 +801,8 @@ else typ = -1; endif - withclause{data_idx} = sprintf ("with %s %s %s lt %d", - style, pt, ps, typ); + withclause{data_idx} = sprintf ("with %s %s %s %s lt %d", + style, lw, pt, ps, typ); endif if (nd == 3)