changeset 7664:0dff8d9bf229

Fix for plot(zeros(1,0),zeros(1,0))
author David Bateman <dbateman@free.fr>
date Fri, 28 Mar 2008 12:51:14 -0400
parents c00d467bef6b
children aead4b9d026b
files scripts/ChangeLog scripts/plot/__plt2__.m
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Thu Mar 27 22:26:57 2008 -0400
+++ b/scripts/ChangeLog	Fri Mar 28 12:51:14 2008 -0400
@@ -1,3 +1,8 @@
+2008-03-27  David Bateman  <dbateman@free.fr>
+
+	* plot/__plt2__.m: Test if args are empty first so that
+	plot(zeros(1,0),zeros(1,0)) works as expected.
+
 2008-03-27  Bill Denney  <bill@denney.ws>
 
 	* time/datenum.m: Allow vector inputs in any orientation.
--- a/scripts/plot/__plt2__.m	Thu Mar 27 22:26:57 2008 -0400
+++ b/scripts/plot/__plt2__.m	Fri Mar 28 12:51:14 2008 -0400
@@ -48,7 +48,9 @@
   endif
 
   h_set = false;
-  if (isscalar (x1))
+  if (isempty (x1) && isempty (x2))
+    retval = zeros (0, 1);
+  elseif (isscalar (x1))
     if (isscalar (x2))
       retval = __plt2ss__ (h, x1, x2, options, properties);
     elseif (isvector (x2))
@@ -74,8 +76,6 @@
     else
       error ("__plt2__: invalid data for plotting");
     endif
-  elseif (isempty (x1) && isempty (x2))
-    retval = zeros (0, 1);
   else
     error ("__plt2__: invalid data for plotting");
   endif