Mercurial > hg > octave-lyh
comparison scripts/plot/__errplot__.m @ 6146:1a6d826e92b5
[project @ 2006-11-09 03:13:11 by jwe]
author | jwe |
---|---|
date | Thu, 09 Nov 2006 03:15:23 +0000 |
parents | 34f96dd5441b |
children | 8614649c454c |
comparison
equal
deleted
inserted
replaced
6145:14906c2745e3 | 6146:1a6d826e92b5 |
---|---|
35 | 35 |
36 function __errplot__ (fstr, a1, a2, a3, a4, a5, a6) | 36 function __errplot__ (fstr, a1, a2, a3, a4, a5, a6) |
37 | 37 |
38 __plot_globals__; | 38 __plot_globals__; |
39 | 39 |
40 cf = __current_figure__; | |
41 mxi = __multiplot_xi__; | |
42 myi = __multiplot_yi__; | |
43 | |
40 __setup_plot__ ("__gnuplot_plot__"); | 44 __setup_plot__ ("__gnuplot_plot__"); |
41 | 45 |
42 if (nargin < 3 || nargin > 7) # at least three data arguments needed | 46 if (nargin < 3 || nargin > 7) # at least three data arguments needed |
43 print_usage (); | 47 print_usage (); |
44 endif | 48 endif |
45 | 49 |
46 j = __plot_data_offset__{__current_figure__}(__multiplot_xi__,__multiplot_yi__); | 50 j = __plot_data_offset__{cf}(mxi,myi); |
47 | 51 |
48 fmt = __pltopt__ ("__errplot__", fstr); | 52 loff = __plot_line_offset__{cf}(mxi,myi); |
53 | |
54 [fmt, key] = __pltopt__ ("__errplot__", fstr); | |
55 | |
56 nkey = numel (key); | |
49 | 57 |
50 nplots = size (a1, 2); | 58 nplots = size (a1, 2); |
51 len = size (a1, 1); | 59 len = size (a1, 1); |
52 for i = 1:nplots | 60 for i = 1:nplots |
53 ifmt = fmt(1+mod(i,size(fmt,1)), :); | 61 ifmt = fmt{1+mod(i-1,numel(fmt))}; |
62 if (i <= nkey) | |
63 __plot_key_labels__{cf}{mxi,myi}{loff} = key{i}; | |
64 else | |
65 __plot_key_labels__{cf}{mxi,myi}{loff} = ""; | |
66 endif | |
54 switch (nargin - 1) | 67 switch (nargin - 1) |
55 case 2 | 68 case 2 |
56 tmp = [(1:len)', a1(:,i), a2(:,i)]; | 69 tmp = [(1:len)', a1(:,i), a2(:,i)]; |
57 case 3 | 70 case 3 |
58 tmp = [a1(:,i), a2(:,i), a3(:,i)]; | 71 tmp = [a1(:,i), a2(:,i), a3(:,i)]; |
71 tmp = [a1(:,i), a2(:,i), ... | 84 tmp = [a1(:,i), a2(:,i), ... |
72 a1(:,i)-a3(:,i), a1(:,i)+a4(:,i), ... | 85 a1(:,i)-a3(:,i), a1(:,i)+a4(:,i), ... |
73 a2(:,i)-a5(:,i), a2(:,i)+a6(:,i)]; | 86 a2(:,i)-a5(:,i), a2(:,i)+a6(:,i)]; |
74 endswitch | 87 endswitch |
75 | 88 |
76 __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j} = tmp; | 89 __plot_data__{cf}{mxi,myi}{j} = tmp; |
77 | 90 |
78 __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} \ | 91 __plot_command__{cf}{mxi,myi} \ |
79 = sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d} %s", | 92 = sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d} %s %s __plot_key_labels__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d}", |
80 __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}, | 93 __plot_command__{cf}{mxi,myi}, |
81 __plot_command_sep__, j, ifmt); | 94 __plot_command_sep__, j, ifmt, |
95 gnuplot_command_title, loff); | |
82 __plot_command_sep__ = ",\\\n"; | 96 __plot_command_sep__ = ",\\\n"; |
83 | 97 |
84 j++; | 98 j++; |
99 loff++; | |
85 | 100 |
86 endfor | 101 endfor |
87 | 102 |
88 __plot_data_offset__{__current_figure__}(__multiplot_xi__,__multiplot_yi__) = j; | 103 __plot_data_offset__{cf}(mxi,myi) = j; |
104 __plot_line_offset__{cf}(mxi,myi) = loff; | |
89 | 105 |
90 if (! isempty (__plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__})) | 106 if (! isempty (__plot_command__{cf}{mxi,myi})) |
91 if (__multiplot_mode__) | 107 if (__multiplot_mode__) |
92 __gnuplot_raw__ ("clear\n"); | 108 __gnuplot_raw__ ("clear\n"); |
93 endif | 109 endif |
94 eval (__plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}); | 110 __do_legend__ (); |
111 eval (__plot_command__{cf}{mxi,myi}); | |
95 endif | 112 endif |
96 | 113 |
97 endfunction | 114 endfunction |