annotate scripts/plot/plot.m @ 1315:611d403c7f3d

[project @ 1995-06-25 19:56:32 by jwe]
author jwe
date Sun, 25 Jun 1995 19:56:32 +0000
parents 3f257ab07921
children 5d29638dd524
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1014
3f257ab07921 [project @ 1995-01-04 19:06:56 by jwe]
jwe
parents: 934
diff changeset
1 # Copyright (C) 1993, 1994, 1995 John W. Eaton
245
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
2 #
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
3 # This file is part of Octave.
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
4 #
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
5 # Octave is free software; you can redistribute it and/or modify it
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
6 # under the terms of the GNU General Public License as published by the
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
7 # Free Software Foundation; either version 2, or (at your option) any
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
8 # later version.
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
9 #
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
10 # Octave is distributed in the hope that it will be useful, but WITHOUT
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
13 # for more details.
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
14 #
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
15 # You should have received a copy of the GNU General Public License
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
16 # along with Octave; see the file COPYING. If not, write to the Free
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1014
diff changeset
17 # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
245
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
18
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
19 function plot (...)
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
20
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
21 # usage: plot (x, y)
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
22 # plot (x1, y1, x2, y2, ...)
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
23 # plot (x, y, fmt)
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
24 #
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
25 # If the first argument is a vector and the second is a matrix, the
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
26 # the vector is plotted versus the columns (or rows) of the matrix.
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
27 # (using whichever combination matches, with columns tried first.)
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
28 #
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
29 # If the first argument is a matrix and the second is a vector, the
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
30 # the columns (or rows) of the matrix are plotted versus the vector.
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
31 # (using whichever combination matches, with columns tried first.)
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
32 #
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
33 # If both arguments are vectors, the elements of y are plotted versus
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
34 # the elements of x.
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
35 #
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
36 # If both arguments are matrices, the columns of y are plotted versus
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
37 # the columns of x. In this case, both matrices must have the same
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
38 # number of rows and columns and no attempt is made to transpose the
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
39 # arguments to make the number of rows match.
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
40 #
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
41 # If both arguments are scalars, a single point is plotted.
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
42 #
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
43 # If only one argument is given, it is taken as the set of y
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
44 # coordinates and the x coordinates are taken to be the indices of the
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
45 # elements, starting with 1.
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
46 #
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
47 # To see possible options for FMT please see plot_opt.
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
48 #
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
49 # Examples:
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
50 #
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
51 # plot (x, y, "@12", x, y2, x, y3, "4", x, y4, "+")
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
52 #
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
53 # y will be plotted with points of type 2 ("+") and color 1 (red).
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
54 # y2 will be plotted with lines.
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
55 # y3 will be plotted with lines of color 4.
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
56 # y4 will be plotted with points which are "+"s.
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
57 #
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
58 # plot (b, "*")
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
59 #
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
60 # b will be plotted with points of type "*".
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
61 #
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
62 # See also: semilogx, semilogy, loglog, polar, mesh, contour, plot_opt
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
63 # bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
64
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
65 set nologscale;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
66 set nopolar;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
67
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
68 plot_int ("plot", all_va_args);
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
69
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
70 endfunction