# HG changeset patch # User David Bateman # Date 1224514951 -3600 # Node ID ec4d9d657b175614cab50e227dc308f11130a57b # Parent a9d3b88ea6fb8e551fe2203ccf6a7e400390081e Treat line style argument in stairs diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2008-10-20 David Bateman + + * plot/fill.m, plot/quiver.m: Quiet the demos. + * plot/stair.m: Treat a line style argument correctly. + 2008-10-20 John W. Eaton * plot/surfnorm.m: Save and restore hold state. diff --git a/scripts/plot/fill.m b/scripts/plot/fill.m --- a/scripts/plot/fill.m +++ b/scripts/plot/fill.m @@ -115,4 +115,4 @@ %! y1 = cos(t1); %! x2 = sin(t2) + 0.8; %! y2 = cos(t2); -%! h = fill(x1,y1,'r',x2,y2,'g') +%! h = fill(x1,y1,'r',x2,y2,'g'); diff --git a/scripts/plot/quiver.m b/scripts/plot/quiver.m --- a/scripts/plot/quiver.m +++ b/scripts/plot/quiver.m @@ -83,7 +83,7 @@ %!demo %! [x,y] = meshgrid(1:2:20); -%! h = quiver(x,y,sin(2*pi*x/10),sin(2*pi*y/10)) +%! h = quiver(x,y,sin(2*pi*x/10),sin(2*pi*y/10)); %! set (h, "maxheadsize", 0.33); %!demo diff --git a/scripts/plot/stairs.m b/scripts/plot/stairs.m --- a/scripts/plot/stairs.m +++ b/scripts/plot/stairs.m @@ -137,6 +137,19 @@ xs(ridx,:) = xtmp; ys(ridx,:) = y(2:nr,:); + have_line_spec = false; + for i = 1 : nargin - 1 + arg = varargin {i}; + if ((ischar (arg) || iscell (arg)) && ! have_line_spec) + [linespec, valid] = __pltopt__ ("stairs", arg, false); + if (valid) + have_line_spec = true; + varargin(i) = []; + break; + endif + endif + endfor + if (doplot) h = []; unwind_protect @@ -152,8 +165,13 @@ addlistener (hg, "xdata", @update_data); addlistener (hg, "ydata", @update_data); - tmp = line (xs(:,i).', ys(:,i).', "color", __next_line_color__ (), - "parent", hg); + if (have_line_spec) + tmp = line (xs(:,i).', ys(:,i).', "color", linespec.color, + "parent", hg); + else + tmp = line (xs(:,i).', ys(:,i).', "color", __next_line_color__ (), + "parent", hg); + endif addproperty ("color", hg, "linecolor", get (tmp, "color")); addproperty ("linewidth", hg, "linelinewidth", get (tmp, "linewidth"));