comparison scripts/plot/__errplot__.m @ 5406:c49aec8a9080

[project @ 2005-07-08 15:25:43 by jwe]
author jwe
date Fri, 08 Jul 2005 15:25:44 +0000
parents 8db4eb48f546
children b2e882e8b68b
comparison
equal deleted inserted replaced
5405:00d369dffec0 5406:c49aec8a9080
34 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> 34 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
35 ## Keywords: errorbar, plotting 35 ## Keywords: errorbar, plotting
36 36
37 function __errplot__ (fstr, a1, a2, a3, a4, a5, a6) 37 function __errplot__ (fstr, a1, a2, a3, a4, a5, a6)
38 38
39 __plot_globals__;
40
39 if (nargin < 3 || nargin > 7) # at least three data arguments needed 41 if (nargin < 3 || nargin > 7) # at least three data arguments needed
40 usage ("__errplot__ (fmt, arg1, ...)"); 42 usage ("__errplot__ (fmt, arg1, ...)");
41 endif 43 endif
44
45 j = __plot_data_offset__(__current_figure__);
42 46
43 fmt = __pltopt__ ("__errplot__", fstr); 47 fmt = __pltopt__ ("__errplot__", fstr);
44 48
45 nplots = size (a1, 2); 49 nplots = size (a1, 2);
46 len = size (a1, 1); 50 len = size (a1, 1);
65 case 6 69 case 6
66 tmp = [a1(:,i), a2(:,i), ... 70 tmp = [a1(:,i), a2(:,i), ...
67 a1(:,i)-a3(:,i), a1(:,i)+a4(:,i), ... 71 a1(:,i)-a3(:,i), a1(:,i)+a4(:,i), ...
68 a2(:,i)-a5(:,i), a2(:,i)+a6(:,i)]; 72 a2(:,i)-a5(:,i), a2(:,i)+a6(:,i)];
69 endswitch 73 endswitch
70 cmd = sprintf ("__gnuplot_plot__ tmp %s", ifmt); 74
71 eval (cmd); 75 __plot_data__{__current_figure__}{j} = tmp;
72 endfor 76
77 __plot_command__{__current_figure__} \
78 = sprintf ("%s%s __plot_data__{__current_figure__}{%d} %s",
79 __plot_command__{__current_figure__},
80 __plot_command_sep__, j, ifmt);
81 __plot_command_sep__ = ",\\\n";
82
83 j++;
84
85 endfor
86
87 __plot_data_offset__(__current_figure__) = j;
88
89 if (! isempty (__plot_command__{__current_figure__}))
90 eval (__plot_command__{__current_figure__});
91 endif
73 92
74 endfunction 93 endfunction