changeset 11954:b6a163a356a2 release-3-2-x

__scatter__.m: If the color spec is empty, set using __next_line_color__.
author Ben Abbott <bpabbott@mac.com>
date Wed, 03 Jun 2009 10:38:17 -0400
parents de6919e0c0f3
children 5ea44288952d
files scripts/ChangeLog scripts/plot/__scatter__.m scripts/plot/scatter3.m
diffstat 3 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-03  Ben Abbott <bpabbott@mac.com>
+
+	* plot/__scatter__.m: If the color spec is empty, set using
+	__next_line_color__.
+	* plot/scatter3.m: Add demos.
+
 	2009-05-25  Jaroslav Hajek  <highegg@gmail.com>
 
 	Version 3.2.0 released.
--- a/scripts/plot/__scatter__.m
+++ b/scripts/plot/__scatter__.m
@@ -74,6 +74,9 @@
       else
 	c = c(:);
       endif
+    elseif (isempty (c))
+      cc = __next_line_color__();
+      c = repmat (cc, numel(x), 1);
     endif
   elseif (firstnonnumeric == istart + 1 && ischar (varargin{istart + 1}))
     c = varargin{istart + 1};
--- a/scripts/plot/scatter3.m
+++ b/scripts/plot/scatter3.m
@@ -83,3 +83,24 @@
 %!demo
 %! [x, y, z] = peaks (20);
 %! scatter3 (x(:), y(:), z(:), [], z(:));
+
+%!demo
+%! x = rand (20,1);
+%! y = rand (20,1);
+%! z = rand (20,1);
+%! scatter3 (x(:), y(:), z(:), 10, z(:), "s");
+
+%!demo
+%! x = rand (20,1);
+%! y = rand (20,1);
+%! z = rand (20,1);
+%! scatter3 (x(:), y(:), z(:), 20*z(:), z(:), "s");
+
+%!demo
+%! x = rand (20,1);
+%! y = rand (20,1);
+%! z = rand (20,1);
+%! scatter3 (x(:), y(:), z(:), 20*z(:), [], "s");
+
+
+