diff scripts/plot/__errplot__.m @ 6405:b298a4c12fc3

[project @ 2007-03-14 16:51:28 by jwe]
author jwe
date Wed, 14 Mar 2007 16:51:30 +0000
parents 44c91c5dfe1d
children 2110cc251779
line wrap: on
line diff
--- a/scripts/plot/__errplot__.m
+++ b/scripts/plot/__errplot__.m
@@ -33,7 +33,7 @@
 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
 ## Keywords: errorbar, plotting
 
-function __errplot__ (fstr, h, a1, a2, a3, a4, a5, a6)
+function h = __errplot__ (fstr, p, a1, a2, a3, a4, a5, a6)
 
   if (nargin < 4 || nargin > 8) # at least two data arguments needed
     print_usage ();
@@ -45,47 +45,44 @@
 
   for i = 1:nplots
     ifmt = fmt{1+mod(i-1,numel(fmt))};
-    s = __uiobject_line_ctor__ (h);
+    h = __line__ (p);
     switch (nargin - 2)
       case 2
-	s.xdata = (1:len)';
-	s.ydata = a1(:,i);
-	s.ldata = a2(:,i);
-	s.udata = a2(:,i);
+	set (h, "xdata", (1:len)');
+	set (h, "ydata", a1(:,i));
+	set (h, "ldata", a2(:,i));
+	set (h, "udata", a2(:,i));
       case 3
-	s.xdata = a1(:,i);
-	s.ydata = a2(:,i);
-	s.ldata = a3(:,i);
-	s.udata = a3(:,i);
+	set (h, "xdata", a1(:,i));
+	set (h, "ydata", a2(:,i));
+	set (h, "ldata", a3(:,i));
+	set (h, "udata", a3(:,i));
       case 4
-	s.xdata = a1(:,i);
-	s.ydata = a2(:,i);
+	set (h, "xdata", a1(:,i));
+	set (h, "ydata", a2(:,i));
 
 	if (index (ifmt, "boxxy") || index (ifmt, "xyerr"))
-	  s.xldata = a3(:,i);
-	  s.xudata = a3(:,i);
-	  s.ldata = a4(:,i);
-	  s.udata = a4(:,i);
+	  set (h, "xldata", a3(:,i));
+	  set (h, "xudata", a3(:,i));
+	  set (h, "ldata", a4(:,i));
+	  set (h, "udata", a4(:,i));
 	elseif (index (ifmt, "xerr"))
-	  s.xldata = a3(:,i);
-	  s.xudata = a4(:,i);
+	  set (h, "xldata", a3(:,i));
+	  set (h, "xudata", a4(:,i));
 	else
-	  s.ldata = a3(:,i);
-	  s.udata = a4(:,i);
+	  set (h, "ldata", a3(:,i));
+	  set (h, "udata", a4(:,i));
 	endif
       case 5
 	error ("error plot requires 2, 3, 4 or 6 columns");
       case 6
-	s.xdata = a1(:,i);
-	s.ydata = a2(:,i);
-	s.xldata = a3(:,i);
-	s.xudata = a4(:,i);
-	s.ldata = a5(:,i);
-	s.udata = a6(:,i);
+	set (h, "xdata", a1(:,i));
+	set (h, "ydata", a2(:,i));
+	set (h, "xldata", a3(:,i));
+	set (h, "xudata", a4(:,i));
+	set (h, "ldata", a5(:,i));
+	set (h, "udata", a6(:,i));
     endswitch
-
-    __uiobject_adopt__ (h, __uiobject_make_handle__ (s));
-
   endfor
 
 endfunction