annotate doc/interpreter/plot.texi @ 2689:8c7955a8d49f

[project @ 1997-02-18 09:06:10 by jwe]
author jwe
date Tue, 18 Feb 1997 09:09:12 +0000
parents 18192eea4973
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
1 @c Copyright (C) 1996, 1997 John W. Eaton
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
2 @c This is part of the Octave manual.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
3 @c For copying conditions, see the file gpl.texi.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
4
2653
e7908588548a [project @ 1997-02-01 16:53:52 by jwe]
jwe
parents: 2570
diff changeset
5 @node Plotting, Matrix Manipulation, Input and Output, Top
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
6 @chapter Plotting
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
7
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
8 All of Octave's plotting functions use @code{gnuplot} to handle the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
9 actual graphics. There are two low-level functions, @code{gplot} and
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
10 @code{gsplot}, that behave almost exactly like the corresponding
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
11 @code{gnuplot} functions @code{plot} and @code{splot}. A number of
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
12 other higher level plotting functions, patterned after the graphics
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
13 functions found in @sc{Matlab} version 3.5, are also available.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
14 These higher level functions are all implemented in terms of the two
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
15 low-level plotting functions.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
16
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
17 @menu
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
18 * Two-Dimensional Plotting::
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
19 * Specialized Two-Dimensional Plots::
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
20 * Three-Dimensional Plotting::
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
21 * Plot Annotations::
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
22 * Multiple Plots on One Page::
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
23 @end menu
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
24
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
25 @node Two-Dimensional Plotting, Specialized Two-Dimensional Plots, Plotting, Plotting
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
26 @section Two-Dimensional Plotting
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
27
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
28 @deffn {Command} gplot @var{ranges} @var{expression} @var{using} @var{title} @var{style}
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
29 Generate a 2-dimensional plot.
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
30
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
31 The @var{ranges}, @var{using}, @var{title}, and @var{style} arguments
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
32 are optional, and the @var{using}, @var{title} and @var{style}
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
33 qualifiers may appear in any order after the expression. You may plot
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
34 multiple expressions with a single command by separating them with
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
35 commas. Each expression may have its own set of qualifiers.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
36
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
37 The optional item @var{ranges} has the syntax
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
38
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
39 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
40 [ x_lo : x_up ] [ y_lo : y_up ]
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
41 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
42
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
43 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
44 and may be used to specify the ranges for the axes of the plot,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
45 independent of the actual range of the data. The range for the y axes
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
46 and any of the individual limits may be omitted. A range @code{[:]}
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
47 indicates that the default limits should be used. This normally means
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
48 that a range just large enough to include all the data points will be
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
49 used.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
50
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
51 The expression to be plotted must not contain any literal matrices
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
52 (e.g. @code{[ 1, 2; 3, 4 ]}) since it is nearly impossible to
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
53 distinguish a plot range from a matrix of data.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
54
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
55 See the help for @code{gnuplot} for a description of the syntax for the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
56 optional items.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
57
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
58 By default, the @code{gplot} command plots the second column of a matrix
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
59 versus the first. If the matrix only has one column, it is taken as a
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
60 vector of y-coordinates and the x-coordinate is taken as the element
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
61 index, starting with zero. For example,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
62
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
63 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
64 gplot rand (100,1) with linespoints
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
65 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
66
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
67 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
68 will plot 100 random values and connect them with lines. When
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
69 @code{gplot} is used to plot a column vector, the indices of the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
70 elements are taken as x values.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
71
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
72 If there are more than two columns, you can
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
73 choose which columns to plot with the @var{using} qualifier. For
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
74 example, given the data
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
75
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
76 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
77 x = (-10:0.1:10)';
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
78 data = [x, sin(x), cos(x)];
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
79 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
80
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
81 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
82 the command
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
83
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
84 @example
2535
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2449
diff changeset
85 gplot [-11:11] [-1.1:1.1] \
caa21ce81913 [project @ 1996-11-19 19:53:55 by jwe]
jwe
parents: 2449
diff changeset
86 data with lines, data using 1:3 with impulses
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
87 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
88
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
89 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
90 will plot two lines. The first line is generated by the command
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
91 @code{data with lines}, and is a graph of the sine function over the
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
92 range @minus{}10 to 10. The data is taken from the first two columns of
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
93 the matrix because columns to plot were not specified with the
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
94 @var{using} qualifier.
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
95
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
96 The clause @code{using 1:3} in the second part of this plot command
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
97 specifies that the first and third columns of the matrix @code{data}
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
98 should be taken as the values to plot.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
99
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
100 In this example, the ranges have been explicitly specified to be a bit
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
101 larger than the actual range of the data so that the curves do not touch
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
102 the border of the plot.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
103 @end deffn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
104
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
105 @deffn {Command} gset options
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
106 @deffnx {Command} gshow options
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
107 @deffnx {Command} replot options
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
108 In addition to the basic plotting commands, the whole range of
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
109 @code{gset} and @code{gshow} commands from @code{gnuplot} are available,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
110 as is @code{replot}.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
111
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
112 @findex set
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
113 @findex show
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
114 Note that in Octave 2.0, the @code{set} and @code{show} commands were
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
115 renamed to @code{gset} and @code{gshow} in order to allow for
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
116 compatibility with the @sc{Matlab} graphics and GUI commands in a future
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
117 version of Octave. (For now, the old @code{set} and @code{show}
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
118 commands do work, but they print an annoying warning message to try to
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
119 get people to switch to using @code{gset} and @code{gshow}.)
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
120
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
121 The @code{gset} and @code{gshow} commands allow you to set and show
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
122 @code{gnuplot} parameters. For more information about the @code{gset}
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
123 and @code{gshow} commands, see the documentation for @code{set} and
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
124 @code{show} in the @code{gnuplot} user's guide (also available on line
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
125 if you run @code{gnuplot} directly, instead of running it from Octave).
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
126
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
127 The @code{replot} command allows you to force the plot to be
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
128 redisplayed. This is useful if you have changed something about the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
129 plot, such as the title or axis labels. The @code{replot} command also
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
130 accepts the same arguments as @code{gplot} or @code{gsplot} (except for
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
131 data ranges) so you can add additional lines to existing plots.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
132
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
133 For example,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
134
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
135 @example
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
136 gset term tek40
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
137 gset output "/dev/plotter"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
138 gset title "sine with lines and cosine with impulses"
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
139 replot "sin (x) w l"
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
140 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
141
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
142 will change the terminal type for plotting, add a title to the current
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
143 plot, add a graph of
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
144 @iftex
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
145 @tex
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
146 $\sin(x)$
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
147 @end tex
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
148 @end iftex
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
149 @ifinfo
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
150 sin (x)
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
151 @end ifinfo
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
152 to the plot, and force the new plot to be
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
153 sent to the plot device. This last step is normally required in order
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
154 to update the plot. This default is reasonable for slow terminals or
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
155 hardcopy output devices because even when you are adding additional
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
156 lines with a replot command, gnuplot always redraws the entire plot, and
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
157 you probably don't want to have a completely new plot generated every
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
158 time something as minor as an axis label changes.
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
159
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
160 @findex shg
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
161 The command @code{shg} is equivalent to executing @code{replot} without
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
162 any arguments.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
163 @end deffn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
164
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
165 @defvr {Built-in Variable} automatic_replot
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
166 You can tell Octave to redisplay the plot each time anything about it
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
167 changes by setting the value of the builtin variable
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
168 @code{automatic_replot} to a nonzero value. Since this is fairly
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
169 inefficient, the default value is 0.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
170 @end defvr
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
171
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
172 Note that NaN values in the plot data are automatically omitted, and
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
173 Inf values are converted to a very large value before calling gnuplot.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
174
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
175 @c XXX FIXME XXX -- add info about what to do to get plots on remote X
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
176 @c terminals. People often forget how to properly set DISPLAY and run
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
177 @c xhost.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
178
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
179 @c XXX FIXME XXX -- add info about getting paper copies of plots.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
180
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
181 The @sc{Matlab}-style two-dimensional plotting commands are:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
182
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
183 @cindex plotting
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
184 @cindex graphics
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
185
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
186 @deftypefn {Function File} {} plot (@var{args})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
187 This function produces two-dimensional plots. Many different
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
188 combinations of arguments are possible. The simplest form is
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
189
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
190 @example
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
191 plot (@var{y})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
192 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
193
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
194 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
195 where the argument is taken as the set of @var{y} coordinates and the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
196 @var{x} coordinates are taken to be the indices of the elements,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
197 starting with 1.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
198
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
199 If more than one argument is given, they are interpreted as
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
200
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
201 @example
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
202 plot (@var{x}, @var{y}, @var{fmt} ...)
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
203 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
204
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
205 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
206 where @var{y} and @var{fmt} are optional, and any number of argument
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
207 sets may appear. The @var{x} and @var{y} values are
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
208 interpreted as follows:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
209
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
210 @itemize @bullet
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
211 @item
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
212 If a single data argument is supplied, it is taken as the set of @var{y}
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
213 coordinates and the @var{x} coordinates are taken to be the indices of
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
214 the elements, starting with 1.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
215
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
216 @item
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
217 If the first argument is a vector and the second is a matrix, the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
218 the vector is plotted versus the columns (or rows) of the matrix.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
219 (using whichever combination matches, with columns tried first.)
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
220
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
221 @item
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
222 If the first argument is a matrix and the second is a vector, the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
223 the columns (or rows) of the matrix are plotted versus the vector.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
224 (using whichever combination matches, with columns tried first.)
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
225
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
226 @item
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
227 If both arguments are vectors, the elements of @var{y} are plotted versus
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
228 the elements of @var{x}.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
229
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
230 @item
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
231 If both arguments are matrices, the columns of @var{y} are plotted
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
232 versus the columns of @var{x}. In this case, both matrices must have
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
233 the same number of rows and columns and no attempt is made to transpose
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
234 the arguments to make the number of rows match.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
235
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
236 If both arguments are scalars, a single point is plotted.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
237 @end itemize
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
238
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
239 The @var{fmt} argument, if present is interpreted as follows. If
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
240 @var{fmt} is missing, the default gnuplot line style is assumed.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
241
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
242 @table @samp
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
243 @item -
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
244 Set lines plot style (default).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
245
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
246 @item .
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
247 Set dots plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
248
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
249 @item @@
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
250 Set points plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
251
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
252 @item -@@
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
253 Set linespoints plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
254
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
255 @item ^
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
256 Set impulses plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
257
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
258 @item L
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
259 Set steps plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
260
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
261 @item #
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
262 Set boxes plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
263
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
264 @item ~
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
265 Set errorbars plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
266
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
267 @item #~
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
268 Set boxerrorbars plot style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
269
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
270 @item @var{n}
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
271 Interpreted as the plot color if @var{n} is an integer in the range 1 to
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
272 6.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
273
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
274 @item @var{nm}
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
275 If @var{nm} is a two digit integer and @var{m} is an integer in the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
276 range 1 to 6, @var{m} is interpreted as the point style. This is only
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
277 valid in combination with the @code{@@} or @code{-@@} specifiers.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
278
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
279 @item @var{c}
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
280 If @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"},
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
281 @code{"c"}, or @code{"w"}, it is interpreted as the plot color (red,
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
282 green, blue, magenta, cyan, or white).
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
283
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
284 @item +
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
285 @itemx *
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
286 @itemx o
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
287 @itemx x
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
288 Used in combination with the points or linespoints styles, set the point
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
289 style.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
290 @end table
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
291
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
292 The color line styles have the following meanings on terminals that
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
293 support color.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
294
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
295 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
296 Number Gnuplot colors (lines)points style
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
297 1 red *
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
298 2 green +
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
299 3 blue o
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
300 4 magenta x
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
301 5 cyan house
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
302 6 brown there exists
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
303 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
304
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
305 Here are some plot examples:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
306
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
307 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
308 plot (x, y, "@@12", x, y2, x, y3, "4", x, y4, "+")
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
309 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
310
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
311 This command will plot @code{y} with points of type 2 (displayed as
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
312 @samp{+}) and color 1 (red), @code{y2} with lines, @code{y3} with lines of
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
313 color 4 (magenta) and @code{y4} with points displayed as @samp{+}.
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
314
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
315 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
316 plot (b, "*")
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
317 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
318
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
319 This command will plot the data in the variable @code{b} will be plotted
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
320 with points displayed as @samp{*}.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
321 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
322
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
323 @deftypefn {Function File} {} hold @var{args}
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
324 Tell Octave to `hold' the current data on the plot when executing
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
325 subsequent plotting commands. This allows you to execute a series of
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
326 plot commands and have all the lines end up on the same figure. The
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
327 default is for each new plot command to clear the plot device first.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
328 For example, the command
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
329
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
330 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
331 hold on
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
332 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
334 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
335 turns the hold state on. An argument of @code{off} turns the hold state
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
336 off, and @code{hold} with no arguments toggles the current hold state.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
337 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
338
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
339 @deftypefn {Function File} {} ishold
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
340 Return 1 if the next line will be added to the current plot, or 0 if
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
341 the plot device will be cleared before drawing the next line.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
342 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
343
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
344 @deftypefn {Function File} {} clearplot
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
345 @deftypefnx {Function File} {} clg
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
346 Clear the plot window and any titles or axis labels. The name
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
347 @code{clg} is aliased to @code{clearplot} for compatibility with @sc{Matlab}.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
348
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
349 The commands @kbd{gplot clear}, @kbd{gsplot clear}, and @kbd{replot
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
350 clear} are equivalent to @code{clearplot}. (Previously, commands like
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
351 @kbd{gplot clear} would evaluate @code{clear} as an ordinary expression
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
352 and clear all the visible variables.)
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
353 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
354
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
355 @deftypefn {Function File} {} closeplot
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
356 Close stream to the @code{gnuplot} subprocess. If you are using X11,
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
357 this will close the plot window.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
358 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
359
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
360 @deftypefn {Function File} {} purge_tmp_files
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
361 Delete the temporary files created by the plotting commands.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
362
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
363 Octave creates temporary data files for @code{gnuplot} and then sends
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
364 commands to @code{gnuplot} through a pipe. Octave will delete the
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
365 temporary files on exit, but if you are doing a lot of plotting you may
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
366 want to clean up in the middle of a session.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
367
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
368 A future version of Octave will eliminate the need to use temporary
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
369 files to hold the plot data.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
370 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
371
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
372 @deftypefn {Function File} {} axis (@var{limits})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
373 Sets the axis limits for plots.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
374
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
375 The argument @var{limits} should be a 2, 4, or 6 element vector. The
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
376 first and second elements specify the lower and upper limits for the x
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
377 axis. The third and fourth specify the limits for the y axis, and the
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
378 fifth and sixth specify the limits for the z axis.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
379
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
380 With no arguments, @code{axis} turns autoscaling on.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
381
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
382 If your plot is already drawn, then you need to use @code{replot} before
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
383 the new axis limits will take effect. You can get this to happen
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
384 automatically by setting the built-in variable @code{automatic_replot}
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
385 to a nonzero value.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
386 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
387
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
388 @node Specialized Two-Dimensional Plots, Three-Dimensional Plotting, Two-Dimensional Plotting, Plotting
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
389 @section Specialized Two-Dimensional Plots
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
390
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
391 @deftypefn {Function File} {} bar (@var{x}, @var{y})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
392 Given two vectors of x-y data, @code{bar} produces a bar graph.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
393
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
394 If only one argument is given, it is taken as a vector of y-values
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
395 and the x coordinates are taken to be the indices of the elements.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
396
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
397 If two output arguments are specified, the data are generated but
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
398 not plotted. For example,
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
399
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
400 @example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
401 bar (x, y);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
402 @end example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
403
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
404 @noindent
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
405 and
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
406
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
407 @example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
408 [xb, yb] = bar (x, y);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
409 plot (xb, yb);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
410 @end example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
411
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
412 @noindent
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
413 are equivalent.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
414 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
415
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
416 @deftypefn {Function File} {} contour (@var{z}, @var{n}, @var{x}, @var{y})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
417 Make a contour plot of the three-dimensional surface described by
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
418 @var{z}. Someone needs to improve @code{gnuplot}'s contour routines
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
419 before this will be very useful.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
420 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
421
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
422 @deftypefn {Function File} {} hist (@var{y}, @var{x})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
423 Produce histogram counts or plots.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
424
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
425 With one vector input argument, plot a histogram of the values with
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
426 10 bins. The range of the histogram bins is determined by the range
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
427 of the data.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
428
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
429 Given a second scalar argument, use that as the number of bins.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
430
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
431 Given a second vector argument, use that as the centers of the bins,
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
432 with the width of the bins determined from the adjacent values in
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
433 the vector.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
434
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
435 Extreme values are lumped in the first and last bins.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
436
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
437 With two output arguments, produce the values @var{nn} and @var{xx} such
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
438 that @code{bar (@var{xx}, @var{nn})} will plot the histogram.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
439 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
440
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
441 @deftypefn {Function File} {} loglog (@var{args})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
442 Make a two-dimensional plot using log scales for both axes. See the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
443 description of @code{plot} above for a description of the arguments that
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
444 @code{loglog} will accept.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
445 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
446
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
447 @deftypefn {Function File} {} polar (@var{theta}, @var{rho})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
448 Make a two-dimensional plot given polar the coordinates @var{theta} and
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
449 @var{rho}.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
450 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
451
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
452 @deftypefn {Function File} {} semilogx (@var{args})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
453 Make a two-dimensional plot using a log scale for the @var{x} axis. See
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
454 the description of @code{plot} above for a description of the arguments
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
455 that @code{semilogx} will accept.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
456 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
457
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
458 @deftypefn {Function File} {} semilogy (@var{args})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
459 Make a two-dimensional plot using a log scale for the @var{y} axis. See
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
460 the description of @code{plot} above for a description of the arguments
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
461 that @code{semilogy} will accept.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
462 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
463
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
464 @deftypefn {Function File} {} stairs (@var{x}, @var{y})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
465 Given two vectors of x-y data, bar produces a `stairstep' plot.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
466
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
467 If only one argument is given, it is taken as a vector of y-values
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
468 and the x coordinates are taken to be the indices of the elements.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
469
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
470 If two output arguments are specified, the data are generated but
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
471 not plotted. For example,
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
472
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
473 @example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
474 stairs (x, y);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
475 @end example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
476
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
477 @noindent
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
478 and
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
479
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
480 @example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
481 [xs, ys] = stairs (x, y);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
482 plot (xs, ys);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
483 @end example
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
484
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
485 @noindent
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
486 are equivalent.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
487 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
488
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
489 @node Three-Dimensional Plotting, Plot Annotations, Specialized Two-Dimensional Plots, Plotting
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
490 @section Three-Dimensional Plotting
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
491
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
492 @deffn {Command} gsplot @var{ranges} @var{expression} @var{using} @var{title} @var{style}
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
493 Generate a 3-dimensional plot.
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
494
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
495 The @var{ranges}, @var{using}, @var{title}, and @var{style} arguments
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
496 are optional, and the @var{using}, @var{title} and @var{style}
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
497 qualifiers may appear in any order after the expression. You may plot
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
498 multiple expressions with a single command by separating them with
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
499 commas. Each expression may have its own set of qualifiers.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
500
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
501 The optional item @var{ranges} has the syntax
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
502
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
503 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
504 [ x_lo : x_up ] [ y_lo : y_up ] [ z_lo : z_up ]
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
505 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
506
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
507 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
508 and may be used to specify the ranges for the axes of the plot,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
509 independent of the actual range of the data. The range for the y and z
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
510 axes and any of the individual limits may be omitted. A range
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
511 @code{[:]} indicates that the default limits should be used. This
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
512 normally means that a range just large enough to include all the data
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
513 points will be used.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
514
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
515 The expression to be plotted must not contain any literal matrices (e.g.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
516 @code{[ 1, 2; 3, 4 ]}) since it is nearly impossible to distinguish a
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
517 plot range from a matrix of data.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
518
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
519 See the help for @code{gnuplot} for a description of the syntax for the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
520 optional items.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
521
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
522 By default, the @code{gsplot} command plots each column of the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
523 expression as the z value, using the row index as the x value, and the
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
524 column index as the y value. The indices are counted from zero, not
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
525 one. For example,
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
526
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
527 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
528 gsplot rand (5, 2)
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
529 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
530
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
531 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
532 will plot a random surface, with the x and y values taken from the row
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
533 and column indices of the matrix.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
534
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
535 If parametric plotting mode is set (using the command
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
536 @kbd{gset parametric}, then @code{gsplot} takes the columns of the
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
537 matrix three at a time as the x, y and z values that define a line in
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
538 three space. Any extra columns are ignored, and the x and y values are
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
539 expected to be sorted. For example, with @code{parametric} set, it
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
540 makes sense to plot a matrix like
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
541 @iftex
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
542 @tex
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
543 $$
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
544 \left[\matrix{
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
545 1 & 1 & 3 & 2 & 1 & 6 & 3 & 1 & 9 \cr
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
546 1 & 2 & 2 & 2 & 2 & 5 & 3 & 2 & 8 \cr
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
547 1 & 3 & 1 & 2 & 3 & 4 & 3 & 3 & 7}\right]
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
548 $$
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
549 @end tex
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
550 @end iftex
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
551 @ifinfo
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
552
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
553 @example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
554 1 1 3 2 1 6 3 1 9
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
555 1 2 2 2 2 5 3 2 8
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
556 1 3 1 2 3 4 3 3 7
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
557 @end example
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
558 @end ifinfo
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
559
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
560 @noindent
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
561 but not @code{rand (5, 30)}.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
562 @end deffn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
563
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
564 The @sc{Matlab}-style three-dimensional plotting commands are:
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
565
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
566 @deftypefn {Function File} {} mesh (@var{x}, @var{y}, @var{z})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
567 Plot a mesh given matrices @code{x}, and @var{y} from @code{meshdom} and
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
568 a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
569 the mesh.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
570 @end deftypefn
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
571
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
572 @deftypefn {Function File} {} meshdom (@var{x}, @var{y})
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
573 Given vectors of @var{x} and @var{y} coordinates, return two matrices
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
574 corresponding to the @var{x} and @var{y} coordinates of the mesh.
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
575
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
576 See the file @file{sombrero.m} for an example of using @code{mesh} and
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
577 @code{meshdom}.
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
578 @end deftypefn
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
579
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
580 @defvr {Built-in Variable} gnuplot_binary
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
581 The name of the program invoked by the plot command. The default value
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
582 is @code{"gnuplot"}. @xref{Installation}.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
583 @end defvr
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
584
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
585 @defvr {Built-in Variable} gnuplot_has_frames
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
586 If the value of this variable is nonzero, Octave assumes that your copy
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
587 of gnuplot has support for multiple frames that is included in recent
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
588 3.6beta releases. It's initial value is determined by configure, but it
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
589 can be changed in your startup script or at the command line in case
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
590 configure got it wrong, or if you upgrade your gnuplot installation.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
591 @end defvr
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
592
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
593 @deftypefn {Function File} {} figure (@var{n})
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
594 Set the current plot window to plot window @var{n}. This function
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
595 currently requires X11 and a version of gnuplot that supports multiple
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
596 frames.
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
597 @end deftypefn
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
598
2449
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
599 @defvr {Built-in Variable} gnuplot_has_multiplot
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
600 If the value of this variable is nonzero, Octave assumes that your copy
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
601 of gnuplot has the multiplot support that is included in recent
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
602 3.6beta releases. It's initial value is determined by configure, but it
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
603 can be changed in your startup script or at the command line in case
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
604 configure got it wrong, or if you upgrade your gnuplot installation.
31d5588dbb61 [project @ 1996-10-30 22:58:44 by jwe]
jwe
parents: 2333
diff changeset
605 @end defvr
2333
b1a56412c385 [project @ 1996-07-19 02:20:16 by jwe]
jwe
parents:
diff changeset
606
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
607 @node Plot Annotations, Multiple Plots on One Page, Three-Dimensional Plotting, Plotting
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
608 @section Plot Annotations
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
609
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
610 @deftypefn {Function File} {} grid
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
611 For two-dimensional plotting, force the display of a grid on the plot.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
612 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
613
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
614 @deftypefn {Function File} {} title (@var{string})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
615 Specify a title for the plot. If you already have a plot displayed, use
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
616 the command @code{replot} to redisplay it with the new title.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
617 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
618
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
619 @deftypefn {Function File} {} xlabel (@var{string})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
620 @deftypefnx {Function File} {} ylabel (@var{string})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
621 @deftypefnx {Function File} {} zlabel (@var{string})
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
622 Specify x, y, and z axis labels for the plot. If you already have a plot
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
623 displayed, use the command @code{replot} to redisplay it with the new
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
624 labels.
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
625 @end deftypefn
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
626
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
627 @node Multiple Plots on One Page, , Plot Annotations, Plotting
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
628 @section Multiple Plots on One Page
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
629
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
630 The following functions all require a version of @code{gnuplot} that
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
631 supports the multiplot feature.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
632
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
633 @deftypefn {Function File} {} mplot (@var{x}, @var{y})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
634 @deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
635 @deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2})
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
636 This is a modified version of the @code{plot} function that works with
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
637 the multiplot version of @code{gnuplot} to plot multiple plots per page.
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
638 This plot version automatically advances to the next subplot position
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
639 after each set of arguments are processed.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
640
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
641 See the description of the @var{plot} function for the various options.
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
642 @end deftypefn
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
643
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
644 @deftypefn {Function File} {} multiplot (@var{xn}, @var{yn})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
645 Sets and resets multiplot mode.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
646
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
647 If the arguments are non-zero, @code{multiplot} will set up multiplot
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
648 mode with @var{xn}, @var{yn} subplots along the @var{x} and @var{y}
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
649 axes. If both arguments are zero, @code{multiplot} closes multiplot
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
650 mode.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
651 @end deftypefn
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
652
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
653 @deftypefn {Function File} {} oneplot ()
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
654 If in multiplot mode, switches to single plot mode.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
655 @end deftypefn
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
656
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
657 @deftypefn {Function File} {} plot_border (...)
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
658 Multiple arguments allowed to specify the sides on which the border
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
659 is shown. Allowed arguments include:
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
660
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
661 @table @code
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
662 @item "blank"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
663 No borders displayed.
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
664
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
665 @item "all"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
666 All borders displayed
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
667
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
668 @item "north"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
669 North Border
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
671 @item "south"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
672 South Border
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
673
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
674 @item "east"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
675 East Border
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
676
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
677 @item "west"
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
678 West Border
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
679 @end table
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
680
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
681 @noindent
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
682 The arguments may be abbreviated to single characters. Without any
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
683 arguments, @code{plot_border} turns borders off.
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
684 @end deftypefn
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
685
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
686 @deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
687 @deftypefnx {Function File} {} subplot (@var{rcn})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
688 Sets @code{gnuplot} in multiplot mode and plots in location
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
689 given by index (there are @var{cols} by @var{rows} subwindows).
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
690
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
691 Input:
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
692
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
693 @table @var
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
694 @item rows
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
695 Number of rows in subplot grid.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
696
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
697 @item columns
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
698 Number of columns in subplot grid.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
699
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
700 @item index
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
701 Index of subplot where to make the next plot.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
702 @end table
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
703
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
704 If only one argument is supplied, then it must be a three digit value
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
705 specifying the location in digits 1 (rows) and 2 (columns) and the plot
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
706 index in digit 3.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
707
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
708 The plot index runs row-wise. First all the columns in a row are filled
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
709 and then the next row is filled.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
710
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
711 For example, a plot with 4 by 2 grid will have plot indices running as
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
712 follows:
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
713 @iftex
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
714 @tex
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
715 \vskip 10pt
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
716 \hfil\vbox{\offinterlineskip\hrule
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
717 \halign{\vrule#&&\qquad\hfil#\hfil\qquad\vrule\cr
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
718 height13pt&1&2&3&4\cr height12pt&&&&\cr\noalign{\hrule}
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
719 height13pt&5&6&7&8\cr height12pt&&&&\cr\noalign{\hrule}}}
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
720 \hfil
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
721 \vskip 10pt
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
722 @end tex
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
723 @end iftex
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
724 @ifinfo
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
725 @display
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
726 @group
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
727 +-----+-----+-----+-----+
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
728 | 1 | 2 | 3 | 4 |
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
729 +-----+-----+-----+-----+
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
730 | 5 | 6 | 7 | 8 |
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
731 +-----+-----+-----+-----+
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
732 @end group
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
733 @end display
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
734 @end ifinfo
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
735 @end deftypefn
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
736
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
737 @deftypefn {Function File} {} subwindow (@var{xn}, @var{yn})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
738 Sets the subwindow position in multiplot mode for the next plot. The
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
739 multiplot mode has to be previously initialized using the
2670
18192eea4973 [project @ 1997-02-13 18:29:53 by jwe]
jwe
parents: 2653
diff changeset
740 @code{multiplot} function, otherwise this command just becomes an alias
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents: 2670
diff changeset
741 to @code{multiplot}
2570
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
742 @end deftypefn
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
743
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
744 @deftypefn {Function File} {} top_title (@var{string})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
745 @deftypefnx {Function File} {} bottom_title (@var{string})
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
746 Makes a title with text @var{string} at the top (bottom) of the plot.
58113987ee03 [project @ 1996-12-06 21:12:29 by jwe]
jwe
parents: 2535
diff changeset
747 @end deftypefn