comparison scripts/plot/__errplot__.m @ 4007:31448e09d38e

[project @ 2002-07-26 01:47:32 by jwe]
author jwe
date Fri, 26 Jul 2002 01:47:32 +0000
parents efac4b97bb09
children 0493a367de6f
comparison
equal deleted inserted replaced
4006:efac4b97bb09 4007:31448e09d38e
1 ## Copyright (C) 2000-2002 Teemu Ikonen 1 ## Copyright (C) 2000, 2001, 2002 Teemu Ikonen
2 ## 2 ##
3 ## This file is part of Octave. 3 ## This file is part of Octave.
4 ## 4 ##
5 ## Octave is free software; you can redistribute it and/or modify it 5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by 6 ## under the terms of the GNU General Public License as published by
18 ## 02111-1307, USA. 18 ## 02111-1307, USA.
19 19
20 ## -*- texinfo -*- 20 ## -*- texinfo -*-
21 ## @deftypefn {Function File} {} __errplot__ (@var{args}) 21 ## @deftypefn {Function File} {} __errplot__ (@var{args})
22 ## Really plot errorbar plots. User interface in function errorbar. 22 ## Really plot errorbar plots. User interface in function errorbar.
23 ## 23 ##
24 ## @example 24 ## @example
25 ## __errplot__ (@var{arg1}, @var{arg2}, ..., @var{fmt}) 25 ## __errplot__ (@var{arg1}, @var{arg2}, ..., @var{fmt})
26 ## @end example 26 ## @end example
27 ## 27 ##
28 ## @end deftypefn 28 ## @end deftypefn
50 eval (sprintf ("arg%d = a;", ndata)); 50 eval (sprintf ("arg%d = a;", ndata));
51 else 51 else
52 fstr = a; 52 fstr = a;
53 endif 53 endif
54 endwhile 54 endwhile
55 55
56 fmt = __pltopt__ ("__errplot__", fstr); 56 fmt = __pltopt__ ("__errplot__", fstr);
57 57
58 nplots = size (arg1, 2); 58 nplots = size (arg1, 2);
59 len = size (arg1, 1); 59 len = size (arg1, 1);
60 60
61 if (ndata == 2) 61 if (ndata == 2)
62 for i = 1:nplots, 62 for i = 1:nplots,
63 tmp = [(1:len)', arg1(:,i), arg2(:,i)]; 63 tmp = [(1:len)', arg1(:,i), arg2(:,i)];
64 cmd = sprintf ("gplot tmp %s", fmt(min(i, rows(fmt)), :) ); 64 cmd = sprintf ("gplot tmp %s", fmt(min(i, rows(fmt)), :) );
65 eval (cmd); 65 eval (cmd);
92 for i = 1:nplots, 92 for i = 1:nplots,
93 tstr = "tmp = [arg1(:,i), arg2(:,i), arg1(:,i)-arg3(:,i), arg1(:,i)+arg4(:,i), arg2(:,i)-arg5(:,i), arg2(:,i)+arg6(:,i)];"; 93 tstr = "tmp = [arg1(:,i), arg2(:,i), arg1(:,i)-arg3(:,i), arg1(:,i)+arg4(:,i), arg2(:,i)-arg5(:,i), arg2(:,i)+arg6(:,i)];";
94 eval (tstr); 94 eval (tstr);
95 cmd = sprintf ("gplot tmp %s", fmt(min(i, rows(fmt)), :) ); 95 cmd = sprintf ("gplot tmp %s", fmt(min(i, rows(fmt)), :) );
96 eval (cmd); 96 eval (cmd);
97 endfor 97 endfor
98 else 98 else
99 for i = 1:nplots, 99 for i = 1:nplots,
100 tstr = "tmp = [arg1(:,i)"; 100 tstr = "tmp = [arg1(:,i)";
101 for j = 2:ndata, 101 for j = 2:ndata,
102 tstr = [tstr, sprintf(", arg%d(:,i)", j)]; 102 tstr = [tstr, sprintf(", arg%d(:,i)", j)];
103 endfor 103 endfor
105 eval (tstr); 105 eval (tstr);
106 cmd = sprintf ("gplot tmp %s", fmt(min(i, rows(fmt)), :) ); 106 cmd = sprintf ("gplot tmp %s", fmt(min(i, rows(fmt)), :) );
107 eval (cmd); 107 eval (cmd);
108 endfor 108 endfor
109 endif 109 endif
110
111 endfunction
112
113 110
114 111 endfunction
115