Mercurial > hg > octave-lyh
comparison 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 |
comparison
equal
deleted
inserted
replaced
6404:2005c0169e36 | 6405:b298a4c12fc3 |
---|---|
31 | 31 |
32 ## Created: 18.7.2000 | 32 ## Created: 18.7.2000 |
33 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> | 33 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> |
34 ## Keywords: errorbar, plotting | 34 ## Keywords: errorbar, plotting |
35 | 35 |
36 function __errplot__ (fstr, h, a1, a2, a3, a4, a5, a6) | 36 function h = __errplot__ (fstr, p, a1, a2, a3, a4, a5, a6) |
37 | 37 |
38 if (nargin < 4 || nargin > 8) # at least two data arguments needed | 38 if (nargin < 4 || nargin > 8) # at least two data arguments needed |
39 print_usage (); | 39 print_usage (); |
40 endif | 40 endif |
41 | 41 |
43 | 43 |
44 [len, nplots] = size (a1); | 44 [len, nplots] = size (a1); |
45 | 45 |
46 for i = 1:nplots | 46 for i = 1:nplots |
47 ifmt = fmt{1+mod(i-1,numel(fmt))}; | 47 ifmt = fmt{1+mod(i-1,numel(fmt))}; |
48 s = __uiobject_line_ctor__ (h); | 48 h = __line__ (p); |
49 switch (nargin - 2) | 49 switch (nargin - 2) |
50 case 2 | 50 case 2 |
51 s.xdata = (1:len)'; | 51 set (h, "xdata", (1:len)'); |
52 s.ydata = a1(:,i); | 52 set (h, "ydata", a1(:,i)); |
53 s.ldata = a2(:,i); | 53 set (h, "ldata", a2(:,i)); |
54 s.udata = a2(:,i); | 54 set (h, "udata", a2(:,i)); |
55 case 3 | 55 case 3 |
56 s.xdata = a1(:,i); | 56 set (h, "xdata", a1(:,i)); |
57 s.ydata = a2(:,i); | 57 set (h, "ydata", a2(:,i)); |
58 s.ldata = a3(:,i); | 58 set (h, "ldata", a3(:,i)); |
59 s.udata = a3(:,i); | 59 set (h, "udata", a3(:,i)); |
60 case 4 | 60 case 4 |
61 s.xdata = a1(:,i); | 61 set (h, "xdata", a1(:,i)); |
62 s.ydata = a2(:,i); | 62 set (h, "ydata", a2(:,i)); |
63 | 63 |
64 if (index (ifmt, "boxxy") || index (ifmt, "xyerr")) | 64 if (index (ifmt, "boxxy") || index (ifmt, "xyerr")) |
65 s.xldata = a3(:,i); | 65 set (h, "xldata", a3(:,i)); |
66 s.xudata = a3(:,i); | 66 set (h, "xudata", a3(:,i)); |
67 s.ldata = a4(:,i); | 67 set (h, "ldata", a4(:,i)); |
68 s.udata = a4(:,i); | 68 set (h, "udata", a4(:,i)); |
69 elseif (index (ifmt, "xerr")) | 69 elseif (index (ifmt, "xerr")) |
70 s.xldata = a3(:,i); | 70 set (h, "xldata", a3(:,i)); |
71 s.xudata = a4(:,i); | 71 set (h, "xudata", a4(:,i)); |
72 else | 72 else |
73 s.ldata = a3(:,i); | 73 set (h, "ldata", a3(:,i)); |
74 s.udata = a4(:,i); | 74 set (h, "udata", a4(:,i)); |
75 endif | 75 endif |
76 case 5 | 76 case 5 |
77 error ("error plot requires 2, 3, 4 or 6 columns"); | 77 error ("error plot requires 2, 3, 4 or 6 columns"); |
78 case 6 | 78 case 6 |
79 s.xdata = a1(:,i); | 79 set (h, "xdata", a1(:,i)); |
80 s.ydata = a2(:,i); | 80 set (h, "ydata", a2(:,i)); |
81 s.xldata = a3(:,i); | 81 set (h, "xldata", a3(:,i)); |
82 s.xudata = a4(:,i); | 82 set (h, "xudata", a4(:,i)); |
83 s.ldata = a5(:,i); | 83 set (h, "ldata", a5(:,i)); |
84 s.udata = a6(:,i); | 84 set (h, "udata", a6(:,i)); |
85 endswitch | 85 endswitch |
86 | |
87 __uiobject_adopt__ (h, __uiobject_make_handle__ (s)); | |
88 | |
89 endfor | 86 endfor |
90 | 87 |
91 endfunction | 88 endfunction |