comparison scripts/plot/bar.m @ 4030:22bd65326ec1

[project @ 2002-08-09 18:58:13 by jwe]
author jwe
date Fri, 09 Aug 2002 19:00:16 +0000
parents f8dde1807dee
children ccb4eca28f7e
comparison
equal deleted inserted replaced
4029:2cc57b6169cf 4030:22bd65326ec1
48 ## Author: jwe 48 ## Author: jwe
49 49
50 function [xb, yb] = bar (x, y) 50 function [xb, yb] = bar (x, y)
51 51
52 if (nargin == 1) 52 if (nargin == 1)
53 if (is_vector (x)) 53 if (isvector (x))
54 len = 3 * length (x) + 1; 54 len = 3 * length (x) + 1;
55 tmp_xb = tmp_yb = zeros (len, 1); 55 tmp_xb = tmp_yb = zeros (len, 1);
56 tmp_xb(1) = 0.5; 56 tmp_xb(1) = 0.5;
57 tmp_yb(1) = 0; 57 tmp_yb(1) = 0;
58 k = 1; 58 k = 1;
67 endfor 67 endfor
68 else 68 else
69 error ("bar: argument must be a vector"); 69 error ("bar: argument must be a vector");
70 endif 70 endif
71 elseif (nargin == 2) 71 elseif (nargin == 2)
72 if (is_vector (x) && is_vector (y)) 72 if (isvector (x) && isvector (y))
73 xlen = length (x); 73 xlen = length (x);
74 ylen = length (y); 74 ylen = length (y);
75 if (xlen == ylen) 75 if (xlen == ylen)
76 len = 3 * xlen + 1; 76 len = 3 * xlen + 1;
77 tmp_xb = tmp_yb = zeros (len, 1); 77 tmp_xb = tmp_yb = zeros (len, 1);