comparison scripts/plot/bar.m @ 2311:2b5788792cad

[project @ 1996-07-11 20:18:38 by jwe]
author jwe
date Thu, 11 Jul 1996 20:18:38 +0000
parents 5cffc4b8de57
children 5ca126254d15
comparison
equal deleted inserted replaced
2310:e2a8f216373d 2311:2b5788792cad
15 ### You should have received a copy of the GNU General Public License 15 ### You should have received a copy of the GNU General Public License
16 ### along with Octave; see the file COPYING. If not, write to the Free 16 ### along with Octave; see the file COPYING. If not, write to the Free
17 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA 17 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA
18 ### 02111-1307, USA. 18 ### 02111-1307, USA.
19 19
20 ## usage: [xb, yb] = bar (x, y)
21 ##
22 ## Given two vectors of x-y data, bar produces a `bar' graph.
23 ##
24 ## If only one argument is given, it is taken as a vector of y-values
25 ## and the x coordinates are taken to be the indices of the elements.
26 ##
27 ## If two output arguments are specified, the data are generated but
28 ## not plotted. For example,
29 ##
30 ## bar (x, y);
31 ##
32 ## and
33 ##
34 ## [xb, yb] = bar (x, y);
35 ## plot (xb, yb);
36 ##
37 ## are equivalent.
38 ##
39 ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour,
40 ## stairs, gplot, gsplot, replot, xlabel, ylabel, title
41
20 function [xb, yb] = bar (x, y) 42 function [xb, yb] = bar (x, y)
21
22 ## usage: [xb, yb] = bar (x, y)
23 ##
24 ## Given two vectors of x-y data, bar produces a `bar' graph.
25 ##
26 ## If only one argument is given, it is taken as a vector of y-values
27 ## and the x coordinates are taken to be the indices of the elements.
28 ##
29 ## If two output arguments are specified, the data are generated but
30 ## not plotted. For example,
31 ##
32 ## bar (x, y);
33 ##
34 ## and
35 ##
36 ## [xb, yb] = bar (x, y);
37 ## plot (xb, yb);
38 ##
39 ## are equivalent.
40 ##
41 ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour,
42 ## stairs, gplot, gsplot, replot, xlabel, ylabel, title
43 43
44 if (nargin == 1) 44 if (nargin == 1)
45 if (is_vector (x)) 45 if (is_vector (x))
46 len = 3 * length (x) + 1; 46 len = 3 * length (x) + 1;
47 tmp_xb = tmp_yb = zeros (len, 1); 47 tmp_xb = tmp_yb = zeros (len, 1);