Overview
Comment:discard some files that are probably not especially useful

git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1377 2bfe0521-f11c-4a00-b80e-6202646ff360

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: bb64a0280f83aca79f04fde800ca9f2d5b8da49496f40c44e6bd4a79df86d526
User & Date: arthurcnorman@users.sourceforge.net on 2011-09-02 18:49:16
Other Links: manifest | tags
Context
2011-09-02
18:52:16
discard some files that are probably not especially useful

git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1378 2bfe0521-f11c-4a00-b80e-6202646ff360 check-in: 8e196c7117 user: arthurcnorman@users.sourceforge.net tags: master, trunk

18:49:16
discard some files that are probably not especially useful

git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1377 2bfe0521-f11c-4a00-b80e-6202646ff360 check-in: bb64a0280f user: arthurcnorman@users.sourceforge.net tags: master, trunk

18:41:44
discard some files that are probably not especially useful

git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1376 2bfe0521-f11c-4a00-b80e-6202646ff360 check-in: 2bf132ecc3 user: arthurcnorman@users.sourceforge.net tags: master, trunk

Changes

Deleted r34.1/plot/Copyright version [b7a479a1d8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (C) 1986, 1987, 1990, 1991, 1992   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 * 
 *   Original Software:
 *     Thomas Williams,  Colin Kelley.
 * 
 *   Gnuplot 2.0 additions:
 *       Russell Lang, Dave Kotz, John Campbell.
 *
 *   Gnuplot 3.0 additions:
 *       Gershon Elber and many others.
 * 
 * Send your comments or suggestions to 
 *  info-gnuplot@ames.arc.nasa.gov.
 * This is a mailing list; to join it send a note to 
 *  info-gnuplot-request@ames.arc.nasa.gov.  
 * Send bug reports to
 *  bug-gnuplot@ames.arc.nasa.gov.
 */

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































Deleted r34.1/plot/EPSView.h version [13610bdc68].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * $Id: EPSView.h,v 3.24 1992/02/29 16:29:37 woo Exp woo $
 *
 * $Log: EPSView.h,v $
 * Revision 3.24  1992/02/29  16:29:37  woo
 * gnuplot3.2, beta 4
 *
 */

#import <appkit/View.h>

@interface EPSView:View {}

+ new;

@end

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































Deleted r34.1/plot/EPSView.m version [da8021ccc0].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef lint
static char *RCSid = "$Id: EPSView.m,v 3.24 1992/02/29 16:23:41 woo Exp woo $";
#endif

/*
 * $Log: EPSView.m,v $
# Revision 3.24  1992/02/29  16:23:41  woo
# gnuplot3.2, beta 4
#
 * Revision 3.23  1992/02/21  20:18:16  woo
 * gnuplot3.2, beta 3
 *
 */

#import "EPSView.h"

@implementation EPSView

+ new
{
	self = [super new];
	return self;
}

@end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































Deleted r34.1/plot/EpsViewer.h version [71a6669d47].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * $Id: EpsViewer.h,v 3.24 1992/02/29 16:27:40 woo Exp woo $
 *
 * $Log: EpsViewer.h,v $
 * Revision 3.24  1992/02/29  16:27:40  woo
 * gnuplot3.2, beta 4
 *
 */

#import <appkit/Application.h>
#import <appkit/graphics.h>
#import <dpsclient/dpsclient.h>
#import <appkit/Window.h>

@interface EpsViewer:Application
{
	id theNewWin;
}

- windowCreate:(NXCoord)width Height:(NXCoord)height;
- (NXRect *)nextRectForWidth:(NXCoord)width Height:(NXCoord)height;

@end


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































Deleted r34.1/plot/EpsViewer.m version [993a0d8ccc].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef lint
static char *RCSid = "$Id: EpsViewer.m,v 3.24 1992/02/29 16:27:40 woo Exp woo $";
#endif

/*
 * $Log: EpsViewer.m,v $
# Revision 3.24  1992/02/29  16:27:40  woo
# gnuplot3.2, beta 4
#
 */

#import "EpsViewer.h"
#import "EPSView.h"
#import <appkit/nextstd.h>
#import <appkit/OpenPanel.h>

@implementation EpsViewer

- windowCreate:(NXCoord) width Height:(NXCoord) height
{
	NXRect rect = {{0.0,0.0},{width,height}};
	
	/* create the new window, in a good place */
	theNewWin = [Window
		newContent:[self nextRectForWidth:width Height:height]
		style:NX_TITLEDSTYLE
		backing:NX_RETAINED
		buttonMask:(NX_CLOSEBUTTONMASK | NX_MINIATURIZEBUTTONMASK)
		defer:NO];
	/* we need to receive windowDidBecomeMain: and windowDidResignMain: */
	[theNewWin setDelegate:self];
	/*
	 * create a new EPSView, make it the contentView of our new window,
	 * and destroy the window's old contentView 
	 */
	[[theNewWin setContentView:[EPSView new]] free];
		/* display the window, and bring it forth */
	[theNewWin display];
	[theNewWin makeKeyAndOrderFront:self];	
/*	[theNewWin orderBack:self];			*/
	/* show the frame */
	return self;
}
 
/***************************************************************************/
/* nextRectForWidth:Height: - return the next good content rectangle       */
/*  from Carl F. Sutter's wonderful ViewGif2 'Controller' method...        */
/***************************************************************************/
/* nextTopLeft - return the next good top left window position		   */
/***************************************************************************/

- (NXRect *)nextRectForWidth:(NXCoord)width Height:(NXCoord)height
{
#define OFFSET 10.0
#define MAX_STEPS 20
#define INITIAL_X 356.0
#define INITIAL_Y 241.0
	NXPoint         nxpTopLeft;
	NXRect          nxrTemp;	/* used to find window height	 */
	NXRect          nxrWinHeight;	/* bounds of enclosing window	 */
	NXSize          nxsScreen;	/* size of screen		 */
	static NXRect   nxrResult;	/* the Answer!			 */
	static int      nCurStep = 0;

	/* find a good top-left coord */
	nxpTopLeft.x = INITIAL_X + nCurStep * OFFSET;
	nxpTopLeft.y = INITIAL_Y + nCurStep * OFFSET;
	if (++nCurStep > MAX_STEPS)
		nCurStep = 0;
	/* find window height using nxrTemp */
	nxrTemp.size.width = width;
	nxrTemp.size.height = height;
	nxrTemp.origin.x = nxrTemp.origin.y = 0;
	[Window getFrameRect:&nxrWinHeight forContentRect:&nxrTemp
	 style:NX_TITLEDSTYLE];
	[NXApp getScreenSize:&nxsScreen];
	/* find the lower-left coord */
	nxrResult.origin.x = nxpTopLeft.x;
	nxrResult.origin.y = nxsScreen.height - nxrWinHeight.size.height - nxpTopLeft.y;
	nxrResult.size.width = width;
	nxrResult.size.height = height;
	return (&nxrResult);
}

@end

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































Deleted r34.1/plot/History version [167578b53b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334

		     GNUPLOT 3.2 RELEASE NOTES

This describes changes to gnuplot since version 3.0.

Highlights: 
-----------
Version 3.1 (also known as version 3.0, patchlevel 1) was a bugfix
release.  In particular, it corrected the y logscale error.
Version 3.2 also fixes a number of bugs but contains two major
changes.  The X11 support, in particular, gnuplot_x11.c was completely
rewritten to rely solely on X11 intrinsics and no widget libraries.
This should hopefully make it more portable.  The other major change
is hidden line removal for explicit 3D surfaces.  

This release was deliberately limited in scope in order to
release a new X11 driver and have some hidden line removal capability
quickly.  Version 3.3 will be a much larger modification.


                            ACKNOWLEDGEMENTS

- New generic gnuplot_x11.c, Ed Kubatis <ejk@ux2.ncsa.uiuc.edu>
- Hidden Line Removal for Explicit Surfaces and IRIX 4.0 fixes,
  Gershon Elber <gershon@gr.utah.edu>
- Table Terminal Driver, Kevin Russo <russo@rudedog.nrl.navy.mil>
- PCL5 driver fixes (HPGL page eject),datafile pipe and README,
  Alex Woo <woo@ames.arc.nasa.gov>
- Pbmplus driver & fix to ylog tics, Put FAR pointers in bitmap.c and bitmap.h
  Russell Lang <rjl@monu1.cc.monash.edu.au>
- NeXT Console Driver, Nick Strobel <strobel@phast.phys.washington.edu>
- Fix GNUTERM environment with disk resident BGI drivers,
  Craig Johnston <johnston@maxwell.ee.washington.edu>
- Fix tables for troff in doc2ms, Michael Schuh <schuh@ames.arc.nasa.gov>
- Fix dump when GNUPLOT$HELP undefined, 
  Wolfgang J. Moeller <moeller@gwdgv1.dnet.gwdg.de>
- Fix AMIGA segment limits, Carsten Steger <stegerc@informatik.tu-muenchen.de>
- Bug fix to latex.trm, Rob Cunningham <rkc@xn.ll.mit.edu>

=========================================================================
		     GNUPLOT 3.0 RELEASE NOTES

This describes changes to gnuplot since version 2.02 (ie, 2.0
patchlevel 2). 

Highlights: 
-----------
Gnuplot now handles surfaces as well. A new command names 'splot' (for
surface plot) has been added for that purpose. A number of new 'set'
options for surfaces have also been added and include: isosamples,
view, contour, cntrparam, mapping and surface.  All tic/label/range
setting for x and y axes were extended for z as well.

The size of data file for both curves and surfaces is now independent
of the samples (and iso_samples) variables. Data structures will
automatically be extended to hold the entire data file.

New features:
-------------
3-d plotting with 'splot', and many auxiliary options.

New 'errorbars' plot style.

New 'using x:y{:z}' format (NOT COMPATIBLE WITH GNUPLOT 2.02).

Data file plotting (for both curves and surfaces) does not require
setting samples (and isosamples for surfaces) any more. Size is
increased on the fly, without affecting the sample rate of functions. 

New makefile scheme for unix, that supports lots of flavors.

Command-line editing and history.

Adjustable display of plot border ('set border').

Set-commands 'x/y/zlabel' can now position the label.

Set-command 'title' can now position the title.

New time display command ('set time').

All PostScript devices were rewritten and merged into one (Color
Postscript is supported). Due to this many of the old postscript
terminal driver names are not supported; only 'postscript' is
recognized. Use 'help set terminal postscript' to find out how to get
your old favorite back, and more.

A 'gnuplot' mode for emacs in the file gnuplot.el.

SGI device was improved.

New option to 'set arrow' called 'nohead'. 

List of all new commands:
-------------------------
splot

List of all new set-show commands:
---------------------------------
border, cntrparam, contour, isosamples, mapping, rrange, surface,
time, view, zlabel, ztics, zrange.

List of changed set-show commands:
----------------------------------
arrow, terminal, title, xlabel, ylabel, zlabel

New terminal drivers:
---------------------
vws, apollo, gpr apollo, dumb, BigFig, Super
VGA, ln03/hplj/hpdj, dxf.

Deletions:
----------
The gnut2p translator (translating gnutex to gnuplot) has been removed
from the standard distribution.  It is available for ftp separately at
cs.duke.edu as dist/sources/gnuplot/gnut2p.tar.Z

Bug fixes include:
------------------
Fix a bug in parametric type hangup.

Add a .sty file to fix indexing problem in manual.

Fix a bug in hpljii.

Fix a bug in FIG arrows.


                            ACKNOWLEDGEMENTS

- New PostScript device by Russell Lang (rjl@monu1.cc.monash.edu.au).
- Several bug fixes, manual proofing, World Map by John Campbell
(campbell@nauvax.ucc.nau.edu).
- Eliminating samples from data files, lasergnu, and errorbars by
David Kotz (David.Kotz@Dartmouth.edu).
- New history and line editing capability for Unix and MSDOS, bivariate
  functions and some bug fixes by Tom Tkacik (tkacik@hobbes.cs.gmr.com).
- New using x:y{:z} format by Dennis Linse (djlinse@phoenix.princeton.edu).
- Some polar enhancements, time display and some bug fixes by
Alex Woo (woo@ra-next.arc.nasa.gov).
- Dumb terminal by Francois Pinard (pinard@iro.umontreal.ca).
- VWS device by Walter Speth (speth@dbnpib5.bitnet).
- BigFig device by (ian@augean.ua.oz.au).
- XDF device by Florian Hiss (fhis1231@w204zrz.zrz.tu-berlin.de).
- HP Desk Jet device, overlay support for BCC and more efficient help
and pc.trm for MSDOS by Maurice Castro and Russell Lang
(rjl@monu1.cc.monash.edu.au). 
- New makefile scheme by Roque Donizete De Oliveira and David Kotz
(oliveria@caen.engin.umich.edu and David.Kotz@Dartmouth.edu).
- The 3d extensions, contouring, Super VGA device, and bringing this new
version up by Gershon Elber (gershon@cs.utah.edu).

Other bug fixes/improvments:
= Tom Bopp (tbopp@uhunix.uhcc.hawaii.edu)
= Kenneth H. Carpenter (khc@eece.ksu.edu)
= Mark Christopher (christo@bnr.ca)
= Henk de Haan (haan@irimcf.tudelft.nl)
= David Gillespie (daveg@csvax.cs.caltech.edu)

Beta testers:
+ John Campbell (campbell@nauvax.ucc.nau.edu)
+ Kenneth H. Carpenter (khc@eece.ksu.edu)
+ Gershon Elber (gershon@cs.utah.edu)
+ Pat Empleo (empleop@afal-edwards.af.mil)
+ David Kotz (dfk@moose.dartmouth.edu)
+ Russell Lang (rjl@monu1.cc.monash.edu.au)
+ Tom Tkacik (tkacik@hobbes.cs.gmr.com)
+ Roque Donizete De Oliveira (oliveria@caen.engin.umich.edu)
+ Walter Speth (Speth@dbnpib5.bitnet)
+ Carsten Steger (stegerc@gshalle2.informatik.tu-muenchen.de)

============================================================================

                     GNUPLOT 2.0 RELEASE NOTES

New terminal drivers: ATT6300, Roland DXY800A, EEPIC, emTeX, EPSON LX-800, 
EPSON 60dpi, Fig, HP2648, HPGL, HP LaserJet, Imagen, Kermit-MS Tektronix 
emulator, LaTeX, MCGA, NEC CP6 pinwriter, POSTSCRIPT, Proprinter, Star color 
printer, Tandy DMP-130, Tektronix 410x, SUN, VGA, X11.

Additions:

Command-line arguments are accepted. They are treated as names of
files containing gnuplot commands. Gnuplot loads them, one by one, and
then exits.

Command 'plot' now has a 'title' option to change the information in
the key.  The 'with' option can now specify line type and point type.

Command 'pause'.

Command 'replot' allows the addition of extra plots. 

Command 'save' now saves all the 'set' options, including the last
plot command.

Command 'set autoscale' now accepts autoscaling on the x axis for data
files. The default is autoscaling on both axes. 

Command 'set noclip' disables clipping of points near the border. 'set
clip' reenables clipping. The default used to be 'clip', and is now
'noclip'. Clipping has also been extended to clip lines that extend
outside the borders: line plots are now clipped at the plot boundary.
Formerly, the line stopped at the last in-range data point.

Numerical labelling at tic marks on x and y axes.  Command 'set
format' allows the format of the tic mark labels to be altered.
Commands 'set xtics' and 'set ytics' allow for alphanumeric labels and
arbitrary tic positions. 

Command 'set grid' adds a grid between the tic marks.

Improved key gives sample point or line types.  Key can be disabled
with the 'set nokey'. Key can be positioned anywhere. 

Command 'set label' allows the placement of arbitrary text labels and
arrows. 

Command 'set polar' for polar plots.

Command 'set offsets' for reducing the plotted area.  Useful for polar
plots.

Command 'set size' scales the displayed size of the plot.

Command 'set tics out' causes the tics to be drawn outwards from the
border.  Useful for impulse plots.

Command 'set title' places a text label above the plot.

Commands 'set xlabel' and 'set ylabel' place text labels on the x and
y axes respectively.  Some terminals will place the y label vertically
upwards on the left of the plot, others place the label horizontally
at the left of the plot.

Improved tics on log scales.

Extended comments: comments are allowed anywhere reasonable in the
input line, and continue to the end of the input line.

Line continuation (with \) is added.

Non-interactive use, through redirection or "load" command, is
improved. Error messages expanded to include file name and line
number, and to reprint command line if not interactive.

New plotting styles 'linespoints' and 'dots'.

Blank lines in data files denote "breaks". In lines and linespoints
plot styles, this breaks the curve being drawn and begins at the next
point, without changing the line or point types.

Completely new interactive help system that is similar to VMS help
system. A printed manual can be obtained in LaTeX, troff, or nroff and
is based on the same information as the interactive help.

PC version now compiles with the large model so that gnuplot will
compile with the above additions!

Bug fixes include:
------------------
Bug involving functions plotted on a logarithmic x axis is fixed. 

Errors inside of loaded files now clean up and close files properly.

Numbers of the form xxxxe+nn are now acceptable (+ sign caused error).

Tics are now place inside the borders (some were outside).

Reverse axes now work properly.

Command 'set output ""' used to crash.  

VMS was closing stdout, so 'set output' code changed to avoid closing
it.  VMS version of gnuplot now performs a SET TERM/NOWRAP itself.

Terminal is now reset before closing output file, changing terminal
type or exiting gnuplot.

Several old bugs have been superseded by new ones.


                            ACKNOWLEDGEMENTS

The Unix PC, polar, pause, and offset additions were by John Campbell.
(CAMPBELL@NAUVAX.bitnet)
The Turbo C additions were by Bill Wilson.
(WILSON@NAUVAX.bitnet)
Some of the labelling improvements and combining of these additions 
were by Russell Lang.
(rjl@monu1.cc.monash.oz.au)
The LaTeX driver, the help system, and some of the labelling
improvements were by David Kotz. 
(David.Kotz@Dartmouth.edu)
And of course, the vast majority of the program is by Colin Kelley
and Thomas Williams.
(info-gnuplot@ames.arc.nasa.gov)

=======================================================================

                      GNUPLOT 1.1 RELEASE NOTES

New terminal drivers: AED 512, BBN BitGraph, HP2623, POSTSCRIPT,
Selanar, Vectrix 384.  The PC version now supports Hercules and ATT
6300 monochrome graphics.  Thanks to those who sent these drivers in.

New commands: 'set dummy' and 'show dummy' to select the dummy
variable name; 'replot' to repeat the last 'plot' command.

The exclamation point (!) is now accepted as postfix factorial
operator.  The gamma() function is also included, if your C library
has gamma().  See GAMMA below.

Logical AND (&&) and OR (||) now short-circuit the way they do in C.
That is, the second && operand is not evaluated if the first is false;
the second || operand is not evaluated if the first is true.  The
ternary operator (?:) also does not evaluate the unused operand.  This
change allows for the definition of recursive functions, e.g. a
synonym for the ! factorial operator:

	fact(x) = (x<=1) ? 1 : x*fact(x-1)

GNUPLOT now has a much better memory allocation scheme, replacing most
fixed-size arrays with malloc()'d linked lists.  There is no longer
any artificial maximum on the number of simultaneous plots, number of
points in those plots, or the number of user-defined functions or
variables.  All these are limited only by the memory available to
malloc().  This is a big improvement for memory-starved machines like
PDP-11s or PCs.

Lines beginning with # (also ! in VMS) are treated as comments.  Only
the $ may now be used for a shell escape in VMS, since ! is a comment.

Several old bugs have been superseded by new ones.
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/Intergraph.x11 version [9db54e0c64].

1
2
3
4
5
6
7
8
9
10
#!/bin/sh
mv gnuplot_x11.c gnuplot_x11.c_x
mv corplot.c corplot.c_pc
acc -knr -DSYSV -DUSG -DVFORK -DNOCOPY -DGAMMA=gamma -DGETCWD -DX11 \
-DUNIXPLOT -I/usr/include/X11 -I/usr/include/X11/Xaw *.c \
-lbsd -lplot -lm -o gnuplot.intergraph
mv gnuplot_x11.c_x gnuplot_x11.c
acc -knr -DSYSV -DUSG -DVFORK -DNOCOPY -DGAMMA=gamma -DGETCWD -DX11 \
-DUNIXPLOT -I/usr/include/X11 -I/usr/include/X11/Xaw gnuplot_x11.c \
-lXaw -lXmu -lXt -lXext -lX11 -lbsd -lm -o gnuplot_x11.intergraph
<
<
<
<
<
<
<
<
<
<




















Deleted r34.1/plot/Makefile version [087265c103].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
#
# $Id: makefile.unx,v 3.26 92/03/24 22:36:48 woo Exp Locker: woo $
#
############################################################
#
# GNUPLOT 3.2 Makefile (Unix X11 support) for
#  Apollo/Sun/Dec5000/IBMrs6000/HP9000/SGI/3B1/386IX/Cray
#
# Original version by:
#   oliveria@caen.engin.umich.edu (ROQUE DONIZETE DE OLIVEIRA)
#   Wed, 3 Jul 91 14:31:37 -0400
#
#>>> Customizing: You must customize part of this makefile for your site.
#>>> Then type 'make' for further instructions.
#>>> Customization instructions look like these lines do (#>>>).
#

TARGET = All # What to make by default

############################################################
#>>> Decide where the binaries and manuals will go. 
# directory where to install executables on 'make install'
DEST=/usr/local/bin
# directory for installing man page on 'make man_install'.
MANDEST=/usr/local/man/manl
# where to install help file gnuplot.gih
HELPDEST=/usr/local/lib/gnuplot.gih
#HELPDEST=docs/gnuplot.gih
# Where to send email about bugs and comments (locally)
EMAIL=bug-gnuplot@ames.arc.nasa.gov

############################################################
#>>> Choose your C compiler and basic compiler flags.
CC     = cc # the C compiler
COPTS  = -O # -O if you trust your compiler's optimizer
LD     =$(CC) $(CFLAGS)	    # default loading command
NPROC  = 2
RCSOLD = 3.25
RCSVER = 3.26
RCSCOM = "gnuplot3.2  release6"

############################################################
#>>> Choose some optional features. 
#>>> At this point there are only two optional features:
# READLINE:
#   If READLINE is defined, then command-line editing is supported.
#   Otherwise, your normal terminal editing is all you get.
#   Some machines will not support this, and they will turn this
#   option off (for example, apollos running SR10.2 or SR10.3 and
#   loaded with BSD4.3 instead of SYS5). Note: problems with 
#   gnuplot prompts have been noted when this feature is selected
#   on IBM RS/6000 AIX, and compile errors are encountered on
#   Sequent Dynix 3 and Convex OS 9.0.
# NOCWDRC:
#   If NOCWDRC is defined, then any .gnuplot in the current directory
#   is not read on startup. This is a security consideration
#   especially for root users ( we recommend you define -DNOCWDRC ).
OPTIONS = -DREADLINE -DNOCWDRC

#>>> Optionally install the lasergnu script.
# Lasergnu is a handy shell script for creating a plot from the
# command line and sending it directly to the printer. It currently
# supports postscript and imagen printers, and probably would need
# tailoring to your site.
# Use lasergnu_install to install lasergnu.
# Use lasergnu_noinstall to not install lasergnu (default).
LASERGNU = lasergnu_install

############################################################
# X11 support
#

#>>> List your X11 libraries
X11LIBS = -lX11

#>>> List where the X11 include directory is found (if other than /usr/include)
X11INCLUDES =

#>>> List additional CFLAGS for X11 compilation
# -DOLD_SELECT if you have an old 4.2 BSD OS (e.g. Sun OS 3.5) and
#   encounter compile error for missing include file <sys/select.h>
X11FLAGS = 

#>>> You shouldn't have to change these, since they are controlled by
#>>> Machine dependent definitions below.
#       Compile option for plot.c and TERMFLAGS, to include X11 support
PLOTXFLAG = -DX11
#       make gnuplot_x11 by default
GNUPLOT_X11 = gnuplot_x11
#       install gnuplot_x11 by default
X11INSTALL = x11_install

############################################################
#>>> Okay, you've changed enough. Now type 'make'.

############################################################
# This is used to pass many of the above definitions to make
# subprocesses. Don't change this.
MY_FLAGS  = CC="$(CC)" 	COPTS="$(COPTS)" DEST="$(DEST)" \
		MANDEST="$(MANDEST)" HELPDEST="$(HELPDEST)" \
		EMAIL="$(EMAIL)" LASERGNU="$(LASERGNU)"

############################################################
# Explanations of CFLAGS definitions.
#  These should not need to be changed by you.
# They are set correctly for each machine below. If your machine
# doesn't fit the one of the patterns, override on the make command
# line or make a new target for it and a new _FLAGS definition. 
#  -DNOVFORK if you're unix and you have don't have vfork()
#  -DMEMSET if you need to use memset() instead of bzero() 
#  -DMEMCPY if your bcopy() is called memcpy()
#  -DNOCOPY if you don't have a memcpy() by any name
#  -DGAMMA=foo if your gamma function is called foo(). Apollos have
#    lgamma(3m). If you don't have gamma(), use -DNOGAMMA.
#    The default is -DGAMMA=gamma.
#  -DGETCWD if your unix uses getcwd() instead of getcd()
#    this is needed by HP-UX and Cray Unicos systems.
#  -DULTRIX_KLUDGE if you run X windows on Ultrix and experience the
#    "every other plot" problem.
#  -DCRIPPLED_SELECT if "select errors" are encountered with X. This
#    option is needed on SVR3 platforms with incomplete support for
#    the BSD select() system call
#  -Dunix is required to explicitly define "unix" for SCO and IBM
#   	   RS/6000 running AIX 3.1 
#  -fswitch if you are compiling on a Sun3 (or even -f68881)
#    (but -fswitch is buggy on some systems, so watch out)

# Defaults in case the user types 'make All' directly
# Should match X11_FLAGS's CFLAGS definition
CFLAGS = $(COPTS) $(OPTIONS)

############################################################
# Terminal (device) support
#
# All devices available to a given machine are compiled in by default.
# This documents the flags available in TERMFLAGS, although TERMFLAGS
# is usually controlled by the machine-dependent definitions below.
# See other terminal defines in term.h.
# Define ULTRIX_KLUDGE if you have the every-other plot problem in Ultrix X11.
#
# -DAPOLLO      Apollo Graphics Primitive Resource (window resize after replot)
# -DGPR         Apollo Graphics Primitive Resource (fixed-size window)
# -DCGI         SCO CGI
# -DIRIS4D      IRIS4D series computer
# -DSUN         Sun Microsystems Workstation
# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
# -DUNIXPLOT    unixplot
# -DX11         X11 Window System (This is $(PLOTXFLAG))
TERMFLAGS = -Iterm -DUNIXPLOT $(PLOTXFLAG) 

############################################################
# Library explanations. 
#  You shouldn't need to adjust this; again, it is handled by the
# machine-dependent definitions below.
#
#  -lplot if you have -DUNIXPLOT in TERMFLAGS
#  -lsuntool -lsunwindow -lpixrect  if you have -DSUN in TERMFLAGS
#  -lgl_s if -DIRIS4D in TERMFLAGS
#  -lccgi if -DCGI in TERMFLAGS
LIBS = -lm -lplot

####################################################################
# List of object files except version.o
OBJS = bitmap.o command.o contour.o eval.o graphics.o graph3d.o help.o \
	   internal.o misc.o parse.o plot.o readline.o scanner.o \
	   setshow.o standard.o term.o util.o  

NEXTOBJS = EPSView.o EpsViewer.o
############################################################
# Machine-dependent settings.
#
X11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

DEC_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) " \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS) -DULTRIX_KLUDGE"

APOLLO_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)  -DGAMMA=lgamma" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="-L/usr/lib/X11 -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS) -DAPOLLO -DGPR"

HP_FLAGS = \
    	   CFLAGS="+O1 $(OPTIONS) -DMEMSET -DMEMCPY  -DGETCWD" \
    	   LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="-I/usr/include/X11R4" \
    	   X11LIBS="-L/usr/lib/X11R4 -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DX11"

SUN_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="-lsuntool -lsunwindow -lpixrect $(LIBS)" \
    	   X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " \
    	   PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DUNIXPLOT -DSUN"

SUN_X11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="-lsuntool -lsunwindow -lpixrect $(LIBS)" \
    	   X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS) -DSUN"

SGI_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DNOVFORK" \
    	   LIBS="-lgl_s -lm" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " \
    	   PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DIRIS4D"

SGIX11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DNOVFORK" \
    	   LIBS="-lgl_s -lm -lc_s" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="-L/usr/lib/X11 -lX11" \
     	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
     	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DX11 -DIRIS4D"

CGI_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -Dunix" \
    	   LIBS="-lccgi $(LIBS)" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DUNIXPLOT -DCGI"

3B1_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK" \
    	   LIBS="$(LIBS)" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " \
    	   PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   LD="ld /lib/crt0s.o /lib/shlib.ifile" \
    	   TERMFLAGS="-Iterm -DUNIXPC"

386IX_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -DTCSETSW -DTCGETS" \
    	   LIBS="$(LIBS) -lcposix" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " PLOTXFLAG=" " GNUPLOT_X11=" " \
    	   X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DUNIXPLOT"
386IX_X11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -DTCSETSW -DTCGETS" \
    	   LIBS="$(LIBS) -lcposix" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11="$(GNUPLOT_X11)" \
    	   X11INSTALL= "$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DUNIXPLOT -DX11"
 	
AIX_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -Dunix -DNOVFORK" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

NEXT_FLAGS = \
    	   CFLAGS="$(COPTS) -DGAMMA=lgamma -DNEXT" \
           LIBS="-lNeXT_s -lsys_s -lm" \
    	   X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES=" " X11LIBS=" " PLOTXFLAG=" " \
    	   GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm" OBJS=" $(OBJS) $(NEXTOBJS)"

NEXT_X11_FLAGS = \
    	   CFLAGS="$(COPTS) -DGAMMA=lgamma -DNEXT" \
           LIBS="-lNeXT_s -lsys_s -lm" \
           X11LIBS="-L/usr/lib/X11 -lX11" \
    	   X11INCLUDES="$(X11INCLUDES)" X11FLAGS="$(X11FLAGS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DX11" OBJS=" $(OBJS) $(NEXTOBJS)"

CRAY_FLAGS = \
	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DNOVFORK" \
	   LIBS="-lm" X11FLAGS=" " \
	   X11INCLUDES=" " \
	   X11LIBS=" " \
	   PLOTXFLAG=" " GNUPLOT_X11=" " \
	   X11INSTALL=x11_noinstall \
	   TERMFLAGS="-Iterm"

CRAY_X11_FLAGS = \
	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DNOVFORK" \
	   LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
	   X11INCLUDES="$(X11INCLUDES)" \
	   X11LIBS="$(X11LIBS)" \
	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11="$(GNUPLOT_X11)" \
	   X11INSTALL=$(X11INSTALL) \
	   TERMFLAGS="-Iterm -DX11"

PTX_X11_FLAGS = \
	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DCRIPPLED_SELECT" \
	   LIBS="-lm -lplot" X11FLAGS="$(X11FLAGS)" \
	   X11INCLUDES="$(X11INCLUDES)" \
	   X11LIBS="-lX11 -lseq -lsocket -linet -lnsl" \
	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11="$(GNUPLOT_X11)" \
	   X11INSTALL=$(X11INSTALL) \
	   TERMFLAGS="$(TERMFLAGS)"

CONVEX_X11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DHUGE=8.9e307" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

####################################################################
# List of source files
# Used for makeing shar files, lint, and some dependencies.
DIRS = term demo docs docs/latextut

CSOURCE1 = command.c setshow.c 
CSOURCE2 = help.c graphics.c graph3d.c internal.c 
CSOURCE3 = misc.c eval.c parse.c plot.c readline.c scanner.c standard.c 
CSOURCE4 = bitmap.c term.c util.c version.c
CSOURCE5 = term/amiga.trm term/aed.trm term/cgi.trm term/dumb.trm term/dxf.trm \
	term/dxy.trm term/eepic.trm term/epson.trm term/fig.trm \
	term/hp26.trm term/hp2648.trm term/hpgl.trm term/hpljii.trm \
	term/apollo.trm term/gpr.trm term/ai.trm term/next.trm
CSOURCE6 = term/impcodes.h term/imagen.trm term/object.h \
	term/iris4d.trm term/kyo.trm term/latex.trm term/pbm.trm term/pc.trm 
CSOURCE7 = term/post.trm term/qms.trm term/regis.trm term/sun.trm \
	term/t410x.trm term/tek.trm term/unixpc.trm term/unixplot.trm \
	term/v384.trm term/x11.trm term/bigfig.trm term/vws.trm gnuplot_x11.c
CSOURCE8 = contour.c
NEXTSRC  = EPSView.m EPSView.h EpsViewer.m EpsViewer.h
# not C code, but still needed

DEMOS = demo/1.dat demo/2.dat demo/3.dat demo/contours.demo demo/controls.demo \
	demo/electron.demo demo/glass.dat demo/param.demo demo/polar.demo \
	demo/simple.demo demo/surface1.demo demo/surface2.demo demo/using.dat \
	demo/using.demo demo/world.cor demo/world.dat demo/world.demo \
	demo/err.dat demo/poldat.demo demo/polar.dat demo/errorbar.demo \
	demo/antenna.dat demo/all.demo demo/bivariat.demo demo/hidden.demo

ETC = Copyright README README.gnutex README.amiga makefile.unx makefile.vms  \
	linkopt.amg makefile.amg makefile.ami linkopt.vms buildvms.com \
	lasergnu  README.3d README.x11 README.NeXT \
	term/README History gnuplot.el Intergraph.x11 README.Install

#BETA files (not standard distribution files)
BETA = BETA6
# PC-specific files
PC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
	linkopt.msc linkopt.tc linkopt.tco makefile.msc makefile.tc \
	pcgraph.asm 

# Documentation and help files
DOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
	docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
	docs/gnuplot.1 docs/lasergnu.1 docs/toc_entry.sty \
	docs/titlepage.ms docs/titlepage.tex docs/Makefile.ami
DOCS2 = docs/gnuplot.doc
DOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
	docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
	docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
	docs/latextut/header.tex docs/latextut/tutorial.tex \
	docs/latextut/linepoint.plt

#########################################################################
# Default target (informational)
info:
	@echo "Please do a 'make <MACHINE>' where <MACHINE> is one of the following:"
	@echo 
	@echo "apollo       for Apollo running SR10.3 with Apollo's X11"
	@echo "dec          for Dec3100/5000 running Ultrix 3.1d with MIT's X11"
	@echo "hp           for HP/9000 700 series running HP/UX 8.0 with MIT's X11R4"
	@echo "sun          for Sun sparcstation running SunOS 4.1 with suntools (no X11) "
	@echo "sun_x11      for Sun sparcstation running SunOS 4.1 with suntools and X11 "
	@echo "sgi          for Silicon Graphics IRIS4D machines (no X11) "
	@echo "sgix11       for Silicon Graphics IRIS4D machines (X11) "
	@echo "next         for NeXT Cube and Slab running NeXTOS 2.0+ (no X11)"
	@echo "next_11      for NeXT Cube and Slab running NeXTOS 2.0+ with X11"
	@echo "3b1          for ATT 3b1 machines (no X11) "
	@echo "386ix        for 386 machines running 386/ix (no X11)"
	@echo "386ix_x11    for 386 machines running 386/ix with T.Roell X386"
	@echo "ibmrs6000    for IBM RS/6000 running Aix 3.1 with IBM's X11"
	@echo "x11          for a generic machine (like a sun or dec) with MIT's X11"
	@echo "cray         for Cray Y-MP or Cray-2 running Unicos 6.0 or 6.1 (no X11)"
	@echo "cray_x11     for Cray Y-MP or Cray-2 running Unicos 6.0 or 6.1 with X11"
	@echo "ptx_x11      for Sequent Dynix/PTX with MIT X11"
	@echo "convex_x11   for Convex 9.0 with MIT X11"
	@echo 
	@echo "Examples:"
	@echo
	@echo "         make x11"
	@echo "         make apollo"
	@echo "         make apollo       OPTIONS='-DNOCWDRC' "
	@echo "         make apollo       DEST='/usr/um/misc/bin' "
	@echo "         make dec"
	@echo "         make hp"
	@echo "         make next"
	@echo "         make sun          HELPDEST='/usr/um/misc/lib/gnuplot.gih' "
	@echo "         make sun          X11INCLUDES='-I/usr/local/include' "
	@echo "         make sun_x11"
	@echo "         make sgi"
	@echo "         make 3b1"
	@echo "         make 386ix"
	@echo "         make ibmrs6000    MANDEST='/usr/um/misc/man/man1' COPTS='-O' "
	@echo "         make cray"
	@echo "         make cray_x11"
	@echo 
	@echo "If you just type 'make All' , it will build gnuplot for Unix X11"
	@echo "and the following variables will be used as default:"
	@echo 
	@echo " DEST                     " $(DEST)
	@echo " MANDEST                  " $(MANDEST)
	@echo " HELPDEST                 " $(HELPDEST)
	@echo " EMAIL                    " $(EMAIL)
	@echo " CC                       " $(CC)
	@echo " COPTS                    " $(COPTS)
	@echo " OPTIONS                  " $(OPTIONS)
	@echo " CFLAGS                   " $(CFLAGS)
	@echo " LIBS                     " $(LIBS)
	@echo " X11FLAGS                 " $(X11FLAGS)
	@echo " X11LIBS                  " $(X11LIBS)
	@echo " X11INCLUDES              " $(X11INCLUDES)
	@echo " TERMFLAGS                " $(TERMFLAGS)
	@echo " LASERGNU                 " $(LASERGNU)
	@echo 
	@echo "If you are not familiar with makefiles or just want to know what"
	@echo " 'make <MACHINE>' would  do without actually doing anything, then type"
	@echo " 'make <MACHINE> -n' "
	@echo 

###############################################################
# Targets for each machine

x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(X11_FLAGS)    $(TARGET)

dec:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(DEC_FLAGS)      $(TARGET)

apollo:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(APOLLO_FLAGS)   $(TARGET)

hp:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(HP_FLAGS)       $(TARGET)

next:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(NEXT_FLAGS)     $(TARGET)

next_x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(NEXT_X11_FLAGS)     $(TARGET)

sun:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SUN_FLAGS)      $(TARGET)

sun_x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SUN_X11_FLAGS)  $(TARGET)

sgi:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SGI_FLAGS)      $(TARGET)

sgix11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SGIX11_FLAGS)   $(TARGET)

cgi:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(CGI_FLAGS)      $(TARGET)

3b1:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(3B1_FLAGS)      $(TARGET)

386ix:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(386IX_FLAGS)    $(TARGET)

386ix_x11: 
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(386IX_X11_FLAGS) $(TARGET)

ibmrs6000:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(AIX_FLAGS)      $(TARGET)

cray:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(CRAY_FLAGS)     $(TARGET)
cray_x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(CRAY_X11_FLAGS) $(TARGET)
ptx_x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(PTX_X11_FLAGS) $(TARGET)
convex_x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(CONVEX_X11_FLAGS) $(TARGET)

#############################################################
# Targets that really do something

all:
	@echo "Please just type  'make'  in order to get some information on "
	@echo "how to build gnuplot under Unix and the X Window System."

All:	gnuplot $(GNUPLOT_X11) doc

gnuplot: $(OBJS) version.o
	$(LD) $(OBJS) version.o $(LIBS) -o gnuplot

doc:
	( cd docs; $(MAKE) $(MFLAGS) gnuplot.gih )

gnuplot_x11: gnuplot_x11.c
	$(CC) $(CFLAGS) $(X11FLAGS) $(X11INCLUDES) -o gnuplot_x11 gnuplot_x11.c $(X11LIBS)

################################################################
# Installation instructions

install:
	@echo 
	@echo "Please do a 'make <MACHINE> TARGET=Install' where <MACHINE> is one of the following:"
	@echo 
	@echo "apollo, dec, hp, sun, sun_x11, sgi, sgix11, cgi,"
	@echo "next, next_x11, 3b1, 386ix, 386ix_x11, ibmrs6000,"
	@echo "x11, cray, cray_x11, ptx_x11, convex_x11"
	@echo 
	@echo "Examples:"
	@echo
	@echo "         make x11          TARGET=Install "
	@echo "         make apollo       TARGET=Install "
	@echo "         make dec          TARGET=Install "
	@echo "         make hp           TARGET=Install "
	@echo "         make sun          TARGET=Install HELPDEST='/usr/um/misc/lib/gnuplot.gih' "
	@echo "         make ibmrs6000    TARGET=Install MANDEST='/usr/um/misc/man/man1' COPTS='-O' "
	@echo 
################################################################
# Installation targets

Install: All man_install $(X11INSTALL) $(LASERGNU)
	cp gnuplot     $(DEST)
	strip $(DEST)/gnuplot
	( cd docs; $(MAKE) $(MFLAGS) install-unix HELPDEST=$(HELPDEST) )

x11_install: gnuplot_x11
	cp gnuplot_x11 $(DEST)
	strip $(DEST)/gnuplot_x11

x11_noinstall: 
	@echo "X11 not requested, so gnuplot_x11 program not installed"

man_install: docs/gnuplot.1
	cp docs/gnuplot.1 $(MANDEST)

lasergnu_install: lasergnu docs/lasergnu.1
	cp lasergnu $(DEST)
	chmod 755 $(DEST)/lasergnu
	cp docs/lasergnu.1 $(MANDEST)

lasergnu_noinstall:
	@echo 
	@echo "Lasergnu will not be installed by default."
	@echo "If you think you need the lasergnu script to print"
	@echo " files on the imagen or postscript printers, then"
	@echo " type"
	@echo "      'make <MACHINE> TARGET=Install LASERGNU='lasergnu_install' "
	@echo
	@echo "Lasergnu is really not needed since within gnuplot you can"
	@echo " can create files (in impress or postscript language) and"
	@echo " print them through your favorite print command (lpr, lp, prf, ipr)."
	@echo 

################################################################
# Dependencies

plot.o: plot.c
	$(CC) $(CFLAGS) $(PLOTXFLAG) -c plot.c

term.o: term.h term.c $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
	$(CC) $(CFLAGS) $(TERMFLAGS) -c term.c

version.o:
	$(CC) $(CFLAGS) -DCONTACT=\"$(EMAIL)\" -c version.c

EpsViewer.o : EpsViewer.h EpsViewer.m EPSView.h
	$(CC) -c EpsViewer.m

EPSView.o : EPSView.h EPSView.m
		$(CC) -c EPSView.m  

$(OBJS): plot.h

command.o: command.c
	$(CC) $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"

command.o help.o misc.o: help.h

command.o graphics.o graph3d.o misc.o plot.o setshow.o term.o: setshow.h

bitmap.o term.o: bitmap.h

################################################################
# Miscellaneous targets

SOURCES=plot.h help.h setshow.h bitmap.h term.h $(CSOURCE1) $(CSOURCE2) \
	$(CSOURCE3) $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)\
	 $(CSOURCE8) $(NEXTSRC)

DOCS  = $(DOCS1) $(DOCS2) $(DOCS3)

lint:
	lint -hx $(SOURCES)

clean:
	rm -f *.o *~ *.bak term/*~ term/*.bak
	( cd docs; $(MAKE) $(MFLAGS) clean )
	( cd docs/latextut; $(MAKE) $(MFLAGS) clean )

spotless:
	rm -f *.o *~ *.bak term/*~ term/*.bak TAGS gnuplot gnuplot_x11
	( cd docs; $(MAKE) $(MFLAGS) clean )
	( cd docs/latextut; $(MAKE) $(MFLAGS) spotless )

################################################################
# Making shar files for mailing gnuplot

shar: gnuplot.sh00 gnuplot.sh01 gnuplot.sh02 gnuplot.sh03 gnuplot.sh04 \
	gnuplot.sh05 gnuplot.sh06 gnuplot.sh07 gnuplot.sh08 \
	gnuplot.sh09 gnuplot.sh10 gnuplot.sh11 gnuplot.sh12 \
	gnuplot.sh13 gnuplot.sh14 gnuplot.sh15 

gnuplot.sh00:
	echo '#!/bin/sh' > gnuplot.sh00
	echo '# This is a shell file to make directories' >> gnuplot.sh00
	echo mkdir $(DIRS) >> gnuplot.sh00

gnuplot.sh01: $(ETC)
	shar $(ETC) > gnuplot.sh01

gnuplot.sh02: $(DOCS1)
	shar $(DOCS1) > gnuplot.sh02

gnuplot.sh03: $(DOCS2)
	shar $(DOCS2) > gnuplot.sh03

gnuplot.sh04: $(DOCS3)
	shar $(DOCS3) > gnuplot.sh04

gnuplot.sh05: $(CSOURCE1)
	shar $(CSOURCE1) > gnuplot.sh05

gnuplot.sh06: $(CSOURCE2)
	shar $(CSOURCE2) > gnuplot.sh06

gnuplot.sh07: $(CSOURCE3)
	shar $(CSOURCE3) > gnuplot.sh07

gnuplot.sh08: $(CSOURCE4)
	shar $(CSOURCE4) > gnuplot.sh08

gnuplot.sh09: $(CSOURCE5)
	shar $(CSOURCE5) > gnuplot.sh09

gnuplot.sh10: $(CSOURCE6)
	shar $(CSOURCE6) > gnuplot.sh10

gnuplot.sh11: $(CSOURCE7)
	shar $(CSOURCE7) > gnuplot.sh11

gnuplot.sh12: $(PC)
	shar $(PC) > gnuplot.sh12

gnuplot.sh13: $(CSOURCE8)
	shar $(CSOURCE8) > gnuplot.sh13

gnuplot.sh14: $(DEMOS)
	shar $(DEMOS) > gnuplot.sh14

gnuplot.sh15: $(BETA)
	shar $(BETA) > gnuplot.sh15

tar: $(ETC) $(SOURCES) $(PC) $(DEMOS) $(BETA) $(DOCS)
	$(TAR) cvf /tmp/gnuplot.tar $(ETC) $(SOURCES) $(PC)\
		 $(DEMOS) $(BETA) $(DOCS)
rcsdoc:
	rcs -o-$(RCSOLD) -l$(RCSVER) $(DOCS)

rcs:
	rcs -l$(RCSVER) -c$(RCSCOM) $(ETC) $(SOURCES) $(PC)

ci:
	ci -l$(RCSVER) -m$(RCSCOM) $(SOURCES) $(PC) $(ETC)

cidoc:
	ci -l$(RCSVER) -m$(RCSCOM) $(DOCS)

cidemo:
	ci -l$(RCSVER) -m$(RCSCOM) $(DEMOS)

co:
	co -l -r$(RCSVER) $(ETC) $(SOURCES) $(PC)

codoc:
	co -l -r$(RCSVER) $(DOCS)

codemo:
	co -l -r$(RCSVER) $(DEMOS)

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/Makefile.save version [746aec69eb].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
############################################################
#
# GNUPLOT 3.0 Makefile (Unix X11 Motif/Athena support) for
#  Apollo/Sun/Dec5000/IBMrs6000/HP9000/SGI/3B1/386IX
#
# Original version by:
#   oliveria@caen.engin.umich.edu (ROQUE DONIZETE DE OLIVEIRA)
#   Wed, 3 Jul 91 14:31:37 -0400
#
#>>> Customizing: You must customize part of this makefile for your site.
#>>> Then type 'make' for further instructions.
#>>> Customization instructions look like these lines do (#>>>).
#

TARGET = All # What to make by default

############################################################
#>>> Decide where the binaries and manuals will go. 
# directory where to install executables on 'make install'
DEST=/usr/local/bin
# directory for installing man page on 'make man_install'.
MANDEST=/usr/man/manl
# where to install help file gnuplot.gih
HELPDEST=~/gnuplot
#HELPDEST=docs/gnuplot.gih
# Where to send email about bugs and comments (locally)
EMAIL=hugo

############################################################
#>>> Choose your C compiler and basic compiler flags.
CC     = cc # the C compiler
COPTS  = -O # -O if you trust your compiler's optimizer
LD     =$(CC) $(CFLAGS)	    # default loading command

############################################################
#>>> Choose some optional features. 
#>>> At this point there are only two optional features:
# READLINE:
#   If READLINE is defined, then command-line editing is supported.
#   Otherwise, your normal terminal editing is all you get.
#   Some machines will not support this, and they will turn this
#   option off (for example, apollos running SR10.2 or SR10.3 and
#   loaded with BSD4.3 instead of SYS5). 
# NOCWDRC:
#   If NOCWDRC is defined, then any .gnuplot in the current directory
#   is not read on startup. This is a security consideration
#   especially for root users ( we recommend you define -DNOCWDRC ).
OPTIONS = -DREADLINE -DNOCWDRC

#>>> Optionally install the lasergnu script.
# Lasergnu is a handy shell script for creating a plot from the
# command line and sending it directly to the printer. It currently
# supports postscript and imagen printers, and probably would need
# tailoring to your site.
# Use lasergnu_install to install lasergnu.
# Use lasergnu_noinstall to not install lasergnu (default).
LASERGNU = lasergnu_noinstall

############################################################
# X11 support
#

#>>> List your X11 libraries#
# standard MIT X11 R4:                      -lXaw -lXmu -lXt -lXext -lX11
# Apollo DomainOS 10.3 (R3/Athena):         -L/usr/lib/X11 -lXaw -lXmu -lXt -lX11
# Apollo DomainOS 10.3 (R3/Motif):          -L/usr/lib/X11 -lXm -lXtm -lX11
# IBM RS/6000 AIX 3.1 (R3/Athena):          -L/usr/lpp/X11/Xamples/lib/Xmu \
#                                           -L/usr/lpp/X11/Xamples/lib/Xaw \
#                                           -lXaw -lXmu -lXt -lXext -lX11
# IBM RS/6000 AIX 3.1 (R3/Motif):           -lXm -lXt -lX11
# HP 9000/375 HP-UX 6.5 and 7.0 (R3/Motif): -lXm -lXt -lX11
# Interactive 386/ix with T.Roell X386 and network support:
#                                           -lXaw -lXm -lXt -lXext -lX11 -linet -lpt
X11LIBS = -lXaw -lXmu -lXt -lXext -lX11

#>>> List your X11 include directories
# standard MIT X11 R4: -I/usr/include/X11   -I/usr/include/X11/Xaw 
# Apollo DomainOS 10.3 (R3/Athena):         -I/usr/include/X11
# Apollo DomainOS 10.3 (R3/Motif):          -I/usr/include/Xm
# IBM RS/6000 AIX 3.1 (R3/Athena):          -I/usr/include/X11 \
#                                           -I/usr/lpp/X11/Xamples/lib/Xaw \
#                                           -I/usr/lpp/X11/Xamples/lib/Xaw/X11
# IBM RS/6000 AIX 3.1 (R3/Motif):           -I/usr/include/Xm
# HP 9000/375 HP-UX 6.5 and 7.0 (R3/Motif): -I/usr/include/Xm
# HP 9000/700 HP-UX 8.0 (R4):               -I/usr/include/X11R4 \
#                                           -I/usr/include/X11R4/X11/Xaw
X11INCLUDES = -I/usr/include/X11 -I/usr/include/X11/Xaw -I/zib/include_sun4/X11 -I/zib/include_sun4/X11/Xaw -I/zib/include_sun4

#>>> You shouldn't have to change these, since they are controlled by
#>>> Machine dependent definitions below.
#       Compile option for plot.c and TERMFLAGS, to include X11 support
PLOTXFLAG = -DX11
#   	   this can add to CFLAGS for X11 compilations. Probably needs no change.
X11FLAGS = 
#       make gnuplot_x11 by default
GNUPLOT_X11 = gnuplot_x11
#       install gnuplot_x11 by default
X11INSTALL = x11_install

############################################################
#>>> Okay, you've changed enough. Now type 'make'.

############################################################
# This is used to pass many of the above definitions to make
# subprocesses. Don't change this.
MY_FLAGS  = CC="$(CC)" 	COPTS="$(COPTS)" DEST="$(DEST)" \
		MANDEST="$(MANDEST)" HELPDEST="$(HELPDEST)" \
		EMAIL="$(EMAIL)" LASERGNU="$(LASERGNU)"

############################################################
# Explanations of CFLAGS definitions.
#  These should not need to be changed by you.
# They are set correctly for each machine below. If your machine
# doesn't fit the one of the patterns, override on the make command
# line or make a new target for it and a new _FLAGS definition. 
#  -DNOVFORK if you're unix and you have don't have vfork()
#  -DMEMSET if you need to use memset() instead of bzero() 
#  -DMEMCPY if your bcopy() is called memcpy()
#  -DNOCOPY if you don't have a memcpy() by any name
#  -DGAMMA=foo if your gamma function is called foo(). Apollos have
#    lgamma(3m). If you don't have gamma(), use -DNOGAMMA.
#    The default is -DGAMMA=gamma.
#  -DGETCWD if your unix uses getcwd() instead of getcd()
#    this is needed by HP-UX and Cray Unicos systems.
#  -DULTRIX_KLUDGE if you run X windows on Ultrix and experience the
#    "every other plot" problem.
#  -Dunix is required to explicitly define "unix" for SCO and IBM
#   	   RS/6000 running AIX 3.1 
#  -fswitch if you are compiling on a Sun3 (or even -f68881)
#    (but -fswitch is buggy on some systems, so watch out)

# Defaults in case the user types 'make All' directly
# Should match X11R4_FLAGS's CFLAGS definition
CFLAGS = $(COPTS) $(OPTIONS)

############################################################
# Terminal (device) support
#
# All devices available to a given machine are compiled in by default.
# This documents the flags available in TERMFLAGS, although TERMFLAGS
# is usually controlled by the machine-dependent definitions below.
# See other terminal defines in term.h.
# Define ULTRIX_KLUDGE if you have the every-other plot problem in Ultrix X11.
#
# -DAPOLLO      Apollo Graphics Primitive Resource (window resize after replot)
# -DGPR         Apollo Graphics Primitive Resource (fixed-size window)
# -DCGI         SCO CGI
# -DIRIS4D      IRIS4D series computer
# -DSUN         Sun Microsystems Workstation
# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
# -DUNIXPLOT    unixplot
# -DX11         X11 Window System (This is $(PLOTXFLAG))
TERMFLAGS = -Iterm -DUNIXPLOT $(PLOTXFLAG)

############################################################
# Library explanations. 
#  You shouldn't need to adjust this; again, it is handled by the
# machine-dependent definitions below.
#
#  -lplot if you have -DUNIXPLOT in TERMFLAGS
#  -lsuntool -lsunwindow -lpixrect  if you have -DSUN in TERMFLAGS
#  -lgl_s if -DIRIS4D in TERMFLAGS
#  -lccgi if -DCGI in TERMFLAGS
LIBS = -lm -lplot

############################################################
# Machine-dependent settings.
#
X11R4_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

X11R4_M_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="$(LIBS)" X11FLAGS="-DMOTIF -D_NO_PROTO" \
    	   X11INCLUDES="-I/usr/include/Xm" \
    	   X11LIBS="-lXm -lXt -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

DEC_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) " \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS) -DULTRIX_KLUDGE"

DEC_M_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="$(LIBS)" X11FLAGS="-DMOTIF -D_NO_PROTO" \
    	   X11INCLUDES="-I/usr/include/Xm" \
    	   X11LIBS="-lXm -lXt -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)  -DULTRIX_KLUDGE"

APOLLO_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)  -DGAMMA=lgamma" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="-I/usr/include/X11" \
    	   X11LIBS="-L/usr/lib/X11 -lXaw -lXmu -lXt -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS) -DAPOLLO -DGPR"

APOLLO_M_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)  -DGAMMA=lgamma" \
    	   LIBS="$(LIBS)" X11FLAGS="-DMOTIF" X11INCLUDES="-I/usr/include/Xm" \
    	   X11LIBS="-L/usr/lib/X11 -lXm -lXt -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   TERMFLAGS="$(TERMFLAGS) -DAPOLLO -DGPR"

HP_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DMEMSET -DMEMCPY  -DGETCWD" \
    	   LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="-I/usr/include/X11R4 -I/usr/include/X11R4/X11/Xaw \
	   -I/usr/include/X11 -I/usr/include/X11/Xaw -I/zib/include_sun4/X11 \
           -I/zib/include_sun4/X11/Xaw -I/zib/include_sun4" \
    	   X11LIBS="-L/usr/lib/X11R4 -lXaw -lXmu -lXt -lXext -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DX11"

SUN_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="-lsuntool -lsunwindow -lpixrect $(LIBS)" \
    	   X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " \
    	   PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DUNIXPLOT -DSUN"

SUN_X11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="-lsuntool -lsunwindow -lpixrect $(LIBS)" \
    	   X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS) -DSUN"

SGI_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="-lgl_s -lm" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " \
    	   PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DIRIS4D"

SGIX11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS)" \
    	   LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="-I/usr/include/X11 -I/usr/include/X11/Xaw" \
    	   X11LIBS="-L/usr/lib/X11 -lXaw -lXmu -lXt -lXext -lX11" \
     	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
     	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DX11"

CGI_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -Dunix" \
    	   LIBS="-lccgi $(LIBS)" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DUNIXPLOT -DCGI"

3B1_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK" \
    	   LIBS="$(LIBS)" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " \
    	   PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   LD="ld /lib/crt0s.o /lib/shlib.ifile" \
    	   TERMFLAGS="-Iterm -DUNIXPC"

386IX_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -DTCSETSW -DTCGETS" \
    	   LIBS="$(LIBS) -lcposix" X11FLAGS=" " X11INCLUDES=" " \
    	   X11LIBS=" " PLOTXFLAG=" " GNUPLOT_X11=" " \
    	   X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm -DUNIXPLOT"
386IX_X11_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -DTCSETSW -DTCGETS" \
    	   LIBS="$(LIBS) -lcposix" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
    	   X11LIBS="$(X11LIBS)" PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11="$(GNUPLOT_X11)" \
    	   X11INSTALL= "$(X11INSTALL)" \
    	   TERMFLAGS="-Iterm -DUNIXPLOT -DX11"
 	
AIX_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -Dunix -DNOVFORK" \
    	   LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES="-I/usr/include/X11 -I/usr/lpp/X11/Xamples/lib/Xaw -I/usr/lpp/X11/Xamples/lib/Xaw/X11" \
    	   X11LIBS="-L/usr/lpp/X11/Xamples/lib/Xmu -L/usr/lpp/X11/Xamples/lib/Xaw -lXaw -lXmu -lXt -lXext -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

AIX_M_FLAGS = \
    	   CFLAGS="$(COPTS) $(OPTIONS) -Dunix -DNOVFORK" \
    	   LIBS="$(LIBS)" X11FLAGS="-DMOTIF" X11INCLUDES="-I/usr/include/Xm" \
    	   X11LIBS="-lXm -lXt -lX11" \
    	   PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
    	   X11INSTALL="$(X11INSTALL)" \
    	   TERMFLAGS="$(TERMFLAGS)"

NEXT_FLAGS = \
    	   CFLAGS="$(COPTS) -DNOCWDRC -DGAMMA=lgamma -DNEXT" \
    	   LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
    	   X11INCLUDES=" " X11LIBS=" " PLOTXFLAG=" " \
    	   GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
    	   TERMFLAGS="-Iterm"

####################################################################
# List of object files except version.o
OBJS = bitmap.o command.o contour.o eval.o graphics.o graph3d.o help.o \
	   internal.o misc.o parse.o plot.o readline.o scanner.o \
	   setshow.o standard.o term.o util.o  
####################################################################
# List of source files
# Used for makeing shar files, lint, and some dependencies.
DIRS = term demo docs docs/latextut

CSOURCE1 = command.c setshow.c 
CSOURCE2 = help.c graphics.c graph3d.c internal.c 
CSOURCE3 = misc.c eval.c parse.c plot.c readline.c scanner.c standard.c 
CSOURCE4 = bitmap.c term.c util.c version.c
CSOURCE5 = term/amiga.trm term/aed.trm term/cgi.trm term/dumb.trm term/dxf.trm \
	term/dxy.trm term/eepic.trm term/epson.trm term/fig.trm \
	term/hp26.trm term/hp2648.trm term/hpgl.trm term/hpljii.trm \
	term/apollo.trm term/gpr.trm
CSOURCE6 = term/impcodes.h term/imagen.trm term/object.h \
	term/iris4d.trm term/kyo.trm term/latex.trm term/pc.trm 
CSOURCE7 = term/post.trm term/qms.trm term/regis.trm term/sun.trm \
	term/t410x.trm term/tek.trm term/unixpc.trm term/unixplot.trm \
	term/v384.trm term/x11.trm term/bigfig.trm term/vws.trm gnuplot_x11.c
CSOURCE8 = contour.c
# not C code, but still needed

DEMOS = demo/1.dat demo/2.dat demo/3.dat demo/contours.demo demo/controls.demo \
	demo/electron.demo demo/glass.dat demo/param.demo demo/polar.demo \
	demo/simple.demo demo/surface1.demo demo/surface2.demo demo/using.dat \
	demo/using.demo demo/world.cor demo/world.dat demo/world.demo \
	demo/err.dat demo/poldat.demo demo/polar.dat demo/errorbar.demo \
	demo/antenna.dat demo/all.demo demo/bivariat.demo

ETC = Copyright README README.gnutex README.amiga makefile.unx makefile.vms  \
	linkopt.amg makefile.amg makefile.ami linkopt.vms buildvms.com \
	plot.h help.h setshow.h bitmap.h term.h lasergnu \
	term/README History gnuplot.el Intergraph.x11 README.Install

#BETA files (not standard distribution files)
BETA = BETA10
# PC-specific files
PC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
	linkopt.msc linkopt.tc linkopt.tco makefile.msc makefile.tc \
	pcgraph.asm 

# Documentation and help files
DOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
	docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
	docs/gnuplot.1 docs/lasergnu.1 docs/toc_entry.sty \
	docs/titlepage.ms docs/titlepage.tex docs/Makefile.ami
DOCS2 = docs/gnuplot.doc
DOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
	docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
	docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
	docs/latextut/header.tex docs/latextut/tutorial.tex \
	docs/latextut/linepoint.plt

#########################################################################
# Default target (informational)
info:
	@echo "Please do a 'make <MACHINE>' where <MACHINE> is one of the following:"
	@echo 
	@echo "apollo, apollo_motif       for Apollo running SR10.3 with Apollo's X11R3"
	@echo "dec, dec_motif             for Dec3100/5000 running Ultrix 3.1d with MIT's X11R4"
	@echo "hp                         for HP/9000 700 series running HP/UX 8.0 with MIT's X11R4"
	@echo "sun                        for Sun sparcstation running SunOS 4.1 with suntools (no X11R4) "
	@echo "sun_x11                    for Sun sparcstation running SunOS 4.1 with suntools and X11R4 "
	@echo "sgi                        for Silicon Graphics IRIS4D machines (no X11R4) "
	@echo "sgix11                     for Silicon Graphics IRIS4D machines (X11R4) "
	@echo "next                       for NeXT Cube and Slab running NeXTOS 2.0+ (no X11R4) "
	@echo "3b1                        for ATT 3b1 machines (no X11R4) "
	@echo "386ix                      for 386 machines running 386/ix (no X11)"
	@echo "386ix_x11                  for 386 machines running 386/ix with T.Roell X386"
	@echo "ibmrs6000, ibmrs6000_motif for IBM RS/6000 running Aix 3.1 with IBM's X11R3"
	@echo "x11r4, x11r4_motif         for a generic machine (like a sun or dec) with MIT's X11R4"
	@echo 
	@echo "Examples:"
	@echo
	@echo "         make x11r4"
	@echo "         make x11r4_motif"
	@echo "         make apollo"
	@echo "         make apollo       OPTIONS='-DNOCWDRC' "
	@echo "         make apollo_motif DEST='/usr/um/misc/bin' "
	@echo "         make dec"
	@echo "         make hp"
	@echo "         make next"
	@echo "         make sun          HELPDEST='/usr/um/misc/lib/gnuplot.gih' "
	@echo "         make sun          X11INCLUDES='-I/usr/local/include -I/usr/local/include/X11 -I/usr/local/include/X11/Xaw' "
	@echo "         make sun_x11"
	@echo "         make sgi"
	@echo "         make 3b1"
	@echo "         make 386ix"
	@echo "         make ibmrs6000    MANDEST='/usr/usr/misc/man/man1' COPTS='-O' "
	@echo 
	@echo "If you just type 'make All' , it will build gnuplot for Unix X11R4/Athena"
	@echo "and the following variables will be used as default:"
	@echo 
	@echo " DEST                     " $(DEST)
	@echo " MANDEST                  " $(MANDEST)
	@echo " HELPDEST                 " $(HELPDEST)
	@echo " EMAIL                    " $(EMAIL)
	@echo " CC                       " $(CC)
	@echo " COPTS                    " $(COPTS)
	@echo " OPTIONS                  " $(OPTIONS)
	@echo " CFLAGS                   " $(CFLAGS)
	@echo " LIBS                     " $(LIBS)
	@echo " X11FLAGS                 " $(X11FLAGS)
	@echo " X11LIBS                  " $(X11LIBS)
	@echo " X11INCLUDES              " $(X11INCLUDES)
	@echo " TERMFLAGS                " $(TERMFLAGS)
	@echo " LASERGNU                 " $(LASERGNU)
	@echo 
	@echo "If you are not familiar with makefiles or just want to know what"
	@echo " 'make <MACHINE>' would  do without actually doing anything, then type"
	@echo " 'make <MACHINE> -n' "
	@echo 

###############################################################
# Targets for each machine

x11r4:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(X11R4_FLAGS)    $(TARGET)

x11r4_motif:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(X11R4_M_FLAGS)  $(TARGET)

dec:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(DEC_FLAGS)      $(TARGET)

dec_motif:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(DEC_M_FLAGS)    $(TARGET)

apollo:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(APOLLO_FLAGS)   $(TARGET)

apollo_motif:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(APOLLO_M_FLAGS) $(TARGET)

hp:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(HP_FLAGS)       $(TARGET)

next:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(NEXT_FLAGS)     $(TARGET)

sun:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SUN_FLAGS)      $(TARGET)

sun_x11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SUN_X11_FLAGS)  $(TARGET)

sgi:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SGI_FLAGS)      $(TARGET)

sgix11:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(SGIX11_FLAGS)   $(TARGET)

cgi:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(CGI_FLAGS)      $(TARGET)

3b1:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(3B1_FLAGS)      $(TARGET)

386ix:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(386IX_FLAGS)    $(TARGET)

386ix_x11: 
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(386IX_X11_FLAGS) $(TARGET)

ibmrs6000:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(AIX_FLAGS)      $(TARGET)

ibmrs6000_motif:
	$(MAKE) $(MFLAGS) $(MY_FLAGS) $(AIX_M_FLAGS)    $(TARGET)

#############################################################
# Targets that really do something

all:
	@echo "Please just type  'make'  in order to get some information on "
	@echo "how to build gnuplot under Unix and the X Window System."

All:	gnuplot $(GNUPLOT_X11) doc

gnuplot: $(OBJS) version.o
	$(LD) $(OBJS) version.o $(LIBS) -o gnuplot

doc:
	( cd docs; make $(MFLAGS) gnuplot.gih )

gnuplot_x11: gnuplot_x11.c
	$(CC) $(CFLAGS) $(X11FLAGS) $(X11INCLUDES) -o gnuplot_x11 gnuplot_x11.c $(X11LIBS)

################################################################
# Installation instructions

install:
	@echo 
	@echo "Please do a 'make <MACHINE> TARGET=Install' where <MACHINE> is one of the following:"
	@echo 
	@echo "apollo, apollo_motif, dec, dec_motif, hp, sun, sun_x11, sgi, sgix11"
	@echo "next, 3b1, 386ix, ibmrs6000, ibmrs6000_motif, x11r4, x11r4_motif"
	@echo 
	@echo "Examples:"
	@echo
	@echo "         make x11r4        TARGET=Install "
	@echo "         make apollo       TARGET=Install "
	@echo "         make apollo_motif TARGET=Install DEST='/usr/um/misc/bin' "
	@echo "         make dec          TARGET=Install "
	@echo "         make hp           TARGET=Install "
	@echo "         make sun          TARGET=Install HELPDEST='/usr/um/misc/lib/gnuplot.gih' "
	@echo "         make ibmrs6000    TARGET=Install MANDEST='/usr/um/misc/man/man1' COPTS='-O' "
	@echo 
################################################################
# Installation targets

Install: All man_install $(X11INSTALL) $(LASERGNU)
	cp gnuplot     $(DEST)
	strip $(DEST)/gnuplot
	(cd docs; make $(MFLAGS) install-unix HELPDEST=$(HELPDEST))

x11_install: gnuplot_x11
	cp gnuplot_x11 $(DEST)
	strip $(DEST)/gnuplot_x11

x11_noinstall: 
	@echo "X11 not requested, so gnuplot_x11 program not installed"

man_install: docs/gnuplot.1
	cp docs/gnuplot.1 $(MANDEST)

lasergnu_install: lasergnu docs/lasergnu.1
	cp lasergnu $(DEST)
	chmod 755 $(DEST)/lasergnu
	cp docs/lasergnu.1 $(MANDEST)

lasergnu_noinstall:
	@echo 
	@echo "Lasergnu will not be installed by default."
	@echo "If you think you need the lasergnu script to print"
	@echo " files on the imagen or postscript printers, then"
	@echo " type"
	@echo "      'make <MACHINE> TARGET=Install LASERGNU='lasergnu_install' "
	@echo
	@echo "Lasergnu is really not needed since within gnuplot you can"
	@echo " can create files (in impress or postscript language) and"
	@echo " print them through your favorite print command (lpr, lp, prf, ipr)."
	@echo 

################################################################
# Dependencies

plot.o: plot.c
	$(CC) $(CFLAGS) $(PLOTXFLAG) -c plot.c

term.o: term.h term.c $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
	$(CC) $(CFLAGS) $(TERMFLAGS) -c term.c

version.o:
	$(CC) $(CFLAGS) -DCONTACT=\"$(EMAIL)\" -c version.c

$(OBJS): plot.h

command.o:
	$(CC) $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"

command.o help.o misc.o: help.h

command.o graphics.o graph3d.o misc.o plot.o setshow.o term.o: setshow.h

bitmap.o term.o: bitmap.h

################################################################
# Miscellaneous targets

SOURCES=plot.h help.h setshow.h bitmap.h term.h $(CSOURCE1) $(CSOURCE2) \
	$(CSOURCE3) $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7) $(CSOURCE8)

lint:
	lint -hx $(SOURCES)

clean:
	rm -f *.o *~ *.bak term/*~ term/*.bak
	(cd docs; make $(MFLAGS) clean)
	(cd docs/latextut; make $(MFLAGS) clean)

spotless:
	rm -f *.o *~ *.bak term/*~ term/*.bak TAGS gnuplot gnuplot_x11
	(cd docs; make $(MFLAGS) clean)
	(cd docs/latextut; make $(MFLAGS) spotless)

################################################################
# Making shar files for mailing gnuplot

shar: gnuplot.sh00 gnuplot.sh01 gnuplot.sh02 gnuplot.sh03 gnuplot.sh04 \
	gnuplot.sh05 gnuplot.sh06 gnuplot.sh07 gnuplot.sh08 \
	gnuplot.sh09 gnuplot.sh10 gnuplot.sh11 gnuplot.sh12 \
	gnuplot.sh13 gnuplot.sh14 gnuplot.sh15 

gnuplot.sh00:
	echo '#!/bin/sh' > gnuplot.sh00
	echo '# This is a shell file to make directories' >> gnuplot.sh00
	echo mkdir $(DIRS) >> gnuplot.sh00

gnuplot.sh01: $(ETC)
	shar $(ETC) > gnuplot.sh01

gnuplot.sh02: $(DOCS1)
	shar $(DOCS1) > gnuplot.sh02

gnuplot.sh03: $(DOCS2)
	shar $(DOCS2) > gnuplot.sh03

gnuplot.sh04: $(DOCS3)
	shar $(DOCS3) > gnuplot.sh04

gnuplot.sh05: $(CSOURCE1)
	shar $(CSOURCE1) > gnuplot.sh05

gnuplot.sh06: $(CSOURCE2)
	shar $(CSOURCE2) > gnuplot.sh06

gnuplot.sh07: $(CSOURCE3)
	shar $(CSOURCE3) > gnuplot.sh07

gnuplot.sh08: $(CSOURCE4)
	shar $(CSOURCE4) > gnuplot.sh08

gnuplot.sh09: $(CSOURCE5)
	shar $(CSOURCE5) > gnuplot.sh09

gnuplot.sh10: $(CSOURCE6)
	shar $(CSOURCE6) > gnuplot.sh10

gnuplot.sh11: $(CSOURCE7)
	shar $(CSOURCE7) > gnuplot.sh11

gnuplot.sh12: $(PC)
	shar $(PC) > gnuplot.sh12

gnuplot.sh13: $(CSOURCE8)
	shar $(CSOURCE8) > gnuplot.sh13

gnuplot.sh14: $(DEMOS)
	shar $(DEMOS) > gnuplot.sh14

gnuplot.sh15: $(BETA)
	shar $(BETA) > gnuplot.sh15

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/README version [01b1f1dfc8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

GNUPLOT is a command-driven interactive function plotting program. It
is case sensitive (commands and function names written in lowercase
are not the same as those written in CAPS). All command names may be
abbreviated, as long as the abbreviation is not ambiguous. Any number
of commands may appear on a line, separated by semicolons (;).
Strings are indicated with quotes.  They may be either single or double
quotation marks, e.g.,

         load "filename"
         cd 'dir'

Any command-line arguments are assumed to be names of files containing
GNUPLOT commands, with the exception of standard X11 arguments, which
are processed first. Each file is loaded with the `load` command, in the
order specified. GNUPLOT exits after the last file is processed.  When
no load files are named, gnuplot enters into an interactive mode.

Commands may extend over several input lines, by ending each
line but the last with a backslash (\). The backslash must be the LAST
character on each line. The effect is as if the backslash and newline
were not there. That is, no white space is implied, nor is a comment
terminated. Therefore, commenting out a continued line comments out
the entire command (see `comment`).

For help on any topic, type `help` followed by the name of the topic.

The new GNUPLOT user should begin by reading about the `plot`
command (type `help plot`).  The manual for gnuplot can be printed
either with TeX, troff or nroff.  Look at the docs/Makefile for
the appropriate option.

                   Where to get updates to GNUPLOT

Congratulations on getting this version of GNUPLOT! Unfortunately, it
may not be the most recent version ("you never know where this version
has been!"). You can be sure that it IS the most recent version by
checking one of the official distribution sites, guaranteed to be kept
up to date (of course, if you got this file from one of those sites,
you don't need to check!).

To hear automatically about future releases (and other GNUPLOT news),
join the mailing list; see below.

At the time of this writing, the following are the official
distribution sites and transfer instructions. Note that
prep.ai.mit.edu is NOT an official site, and may not be up to date.
Also, comp.sources.misc is usually a month or so behind us.

Date: Sun Mar 1 20:45:52 EDT 1992
Version: 3.2

In general, GNUPLOT 3.2 is available as the file gnuplot3.2.tar.Z.
There are patches which bring GNUPLOT 3.0 up to 3.1 and patches
which bring GNUPLOT 3.1 up to GNUPLOT 3.2.  The latter are in
the file gnuplot3.2.shar.Z.
There are no patches that bring GNUPLOT 2.02 up to 3.0, so you must
obtain the whole new release. 
Please obtain gnuplot from the site
nearest you.

USENET users:

    GNUPLOT 3.2 was posted to comp.sources.misc.


NORTH AMERICA:

     Anonymous ftp to dartmouth.edu (129.170.16.4)
     Fetch
        pub/gnuplot/gnuplot3.2.tar.Z
     in binary mode.

     Users without ftp capability can obtain it through a mail ftp
     server. Send a mail message saying 'help' to
     BITFTP@pucc.princeton.edu for instructions. For a uuencoded
     copy of the gnuplot sources (compressed tar file), send this
     message to BITFTP@pucc.princeton.edu:
         FTP DARTMOUTH.EDU UUENCODE
         USER ANONYMOUS
         CD pub/gnuplot
         BINARY
         GET gnuplot3.2.tar.Z
         QUIT


AUSTRALIA:

     Anonymous ftp to monu1.cc.monash.edu.au (130.194.1.101).
     Fetch pub/gnuplot3.2.tar.Z in binary mode.


EUROPE:

     Anonymous ftp to irisa.irisa.fr (131.254.2.3).
     Fetch pub/gnuplot3.2.tar.Z in binary mode.

----

     DISCLAIMER - This product is not related in any way to
     Pixar or any other commercial venture.

----
  CONTACTS:
     Please send any questions or comments to
        info-gnuplot@ames.arc.nasa.gov.
     To join the above mailing list (or get yourself off), mail to
        info-gnuplot-request@ames.arc.nasa.gov.
     Send bug reports and problems to
        bug-gnuplot@ames.arc.nasa.gov.

                                        -Thomas Williams-

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































































































































































































































Deleted r34.1/plot/README.3d version [80cb4179cb].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

		   A tutorial on explicit/parametric
				   and
		    everything you did not dare to ask
				  about
			   curves and surfaces
				    in
				  gnuplot

Several types of curves and surface are supported in gnuplot. Of those
not every operation is supported for every curve or surface type and it
can be therefore useful to understand the different types, their advantages
and limitations.

Curves in gnuplot are almost always planar (with one exception which we
will deal with in the end) and are assumed to be in the XY plane.
Therefore only X and Y coordinates are needed for plotting curves.
The simplest curve is the `explicit function`. This curve is in fact a
function and for each given x, there is one and only one y value associated
with it. A gnuplot example for such type is `plot sin(x)` or
`plot "datafile" using 1". Note the later is using only a single column from
the data file which is assumed to be the y values.

Alternatively one can define a `parametric curve` form. In this case
x and y are both functions of a third free parameter t, while independent
of each other. A circle can be expressed parametrically as x = cos(t),
y = sin(t) and be plotted using gnuplot as
'set parametric; plot cos(t),sin(t)'.
This form is not a function since there can be unlimited number of y values
associated with same x. Furthermore the explicit form is a special case of
the parametric representation by letting x equal to t. The curve y = sin(x)
can be written in parametric form as y = sin(t), x = t.

We are used to think of the plane in cartesian coordinate system.
In practice, some coordinate systems may be easier to use then others
under some circumstances. The polar form uses a different basis
to span the XY plane. In this representation the cartesian x coordinate
is equal to r cos(t) and the cartesian y coordinate is equal to r sin(t).
To draw a unit circle using the polar coordinate system in gnuplot use the
following simple command: 'set polar; plot 1'. To better understand this
explicit form lets backup a little.
When we plot a regular explicit function like `y = sin(x)` we march in equal
steps in x, evaluate the provided function and plot a piecewise linear curve
between the sampled points approximating the real function. In the polar
explicit form we do exactly the same thing, but we march along the angular
direction - we turn around the origin, computing the length of the radius
at that angle. Since for the unit circle, this radius is a constant 1,
`plot 1` in polar form plots a circle (if t domain is from 0 or 2Pi).
Note the polar form is explicit in that for each angle there is only a
single radius.

Surprisingly (or maybe not so surprising) surfaces share the same
representations. Since surfaces are two dimensional entities, they
require two free parameters (like t for curves).

A surface explicit function uses x and y as the free parameters. For
each such pair it provides a single z value. An example for this form
can be `splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2)` for a three dimensional
sinc function or `splot 'datafile' using 1`. As for curves, the single column
used from the data file defines the function value or z in this case.
The order of the x and y function values is very strict in this form and
simply defines a rectangular grid in the XY plane. Fortunately this
strict form allows us to apply a very simplistic hidden line algorithm
called "the floating horizon". This hidden line algorithm exploits the
rectangular XY domain of the surface and therefore may be used for this
type of surfaces only. Since in gnuplot this is the only form of hidden
lines removing algorithm provided, only explicit surfaces may have their
hidden lines removed.

Parametric surfaces are the exact extension for explicit surfaces as in
the curves case. the x, y, and z are defined in terms of two new free
variables and are totally independent of each other as x(u, v), y(u, v),
and z(u, v). Again the explicit surface is a special case of the parametric
representation where x = u, and y = v. Examples for plotting parametric
surfaces in gnuplot can be `splot cos(u)*cos(v),cos(u)*sin(v),sin(u)` which
defines a sphere, or `splot "datafile" using 1:2:3`. Since these are
parametric surfaces, gnuplot must be informed to handle them by issuing
`set parametric`.

The curve polar form takes the obvious extensions in the surface world.
The first possible extension is spherical coordinate system, while the
second is the cylinderical one. These modes currently work for data files
only and both requires two parameters, teta and phi for mapping onto the
unit sphere, and teta and z form mapping on a unit radius cylinder as follow:

	Spherical coord.			Cylin. coord.
	----------------			-------------
	x = cos( theta ) * cos( phi )		x = cos( theta )
	y = sin( theta ) * cos( phi )		y = sin( theta )
	z = sin( phi )				z = z

This subject brings us back to non planar curves. When surfaces are displayed
under gnuplot, isocurves are actually getting plotted. An isocurve is a
curve on the surface in which one of the two free parameters of the
surface is fixed. For example the u isolines of a surface are drawn by
setting u to be fixed and varying v along the entire v domain. The v isolines
are similarly drawn by fixing v. When data files are specified they are
classified internally into two types. A surface is tagged to have grid
topology if all its specified isolines are of the same length. A data mesh
of five isolines, seven points each is an example. In such a case the
surface cross isolines are drawn as well. Seven isolines with five points
each will be automatically created and drawn for grid type data. If
however, isolines of different length are found in the data, it is
tagged as nongrid surface and in fact is nothing more than a collection
of three dimensional curves. only the provided data is plotted in that
case (see world.demo for a such an example).

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































Deleted r34.1/plot/README.3p2 version [3f29ce5493].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
This is the official release of GNUPLOT.3.2.  It is available in either
a patch or tar archive.  Sites for the retrieval are listed in the
README.   Below are the modifications and contributors to this release.
The patch file 3_1to3_2.patch needs to be applied with the p1 flag

>cd gnuplot
>patch -p1 < 3_1to3_2.patch

Thanks  ---  Alex Woo

* Subject: New generic gnuplot_x11.c 
  Name: Ed Kubatis
  Email: ejk@ux2.ncsa.uiuc.edu

* Subject: Hidden Line Removal for Explicit Surfaces and IRIX 4.0 fixes.
  Name: Gershon Elber
  Email: gershon@gr.utah.edu

* Subject: Table Terminal Driver.
  Name: Kevin Russo
  Email: russo@rudedog.nrl.navy.mil

* Subject: PCL5 driver fixes (HPGL page eject),datafile pipe and README.
  Name: Alex Woo
  Email: woo@ames.arc.nasa.gov

* Subject: Pbmplus driver and fix to y log tics.
  Name: Russell Lang 
  Email: rjl@monu1.cc.monash.edu.au  

* Subject: NeXT Console Driver.
  Name: Nick Strobel 
  Email: strobel@phast.phys.washington.edu

* Subject: Fix GNUTERM environment with disk resident BGI drivers
  Name: Craig Johnston
  Email: johnston@maxwell.ee.washington.edu

* Subject: Fix tables for troff in doc2ms
  Name: Michael Schuh
  Email: schuh@ames.arc.nasa.gov

* Subject: Fix dump when GNUPLOT$HELP undefined
  Name: Wolfgang J. Moeller
  Email: moeller@gwdgv1.dnet.gwdg.de 
  
* Subject: Fix AMIGA segment limits
  Name: Carsten Steger
  Email: stegerc@informatik.tu-muenchen.de
  
* Subject: Put FAR pointers in bitmap.c and bitmap.h
  Name: Russell Lang 
  Email: rjl@monu1.cc.monash.edu.au  
  
* Subject: Bug fix to latex.trm 
  Name: Rob Cunningham
  Email: rkc@xn.ll.mit.edu
----------------------------------------------------------------------------

                   GNUPLOT 3.1 Patch

This package provides the upgrade of gnuplot 3.0 to patch level 1.
Below are the contributers to this upgrade and the modifications made.

Thank you all

Gershon

----------------------------------------------------------------------------

* Subject: Y log / postscript eps fix
  Name: Russell Lang
  Email: rjl@monu1.cc.monash.edu.au

* Subject: HP26 driver to lift text.
  Name: Bruce Lueckenhoff
  Email: luechen@cis.udel.edu

* Subject: CRAY prt, UIUC coordinates.
  Name: Daniel Lewart
  Email: d-lewart@uiuc.edu

* Subject: AI device
  Name:	Ray Ghanbari
  Email: ray@mtl.mit.edu

* Subject: HP_MOTIF on a Snake, X11 for Next
  Name: Alex Woo
  Email: woo@ra-next.arc.nasa.gov

* Subject: Mod. to LaTeX for multiple curves/plots, complex atan function fix.
  Name: Ray Toy???
  Email: toy@soho.crd.ge.com

* Subject: Fix the "splot 'file.dat'" with only z values.
  Name: Gershon Elber
  Email: gershon@gr.utah.edu

* Subject: Underscore prefixed names.
  Name: Tom Tkacik
  Email: tkacik@hobbes.cs.gmr.com

* Subject: Amiga port
  Name: Carsten Steger 
  Email: stegerc@informatik.tu-muenchen.de
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































































































































































































Deleted r34.1/plot/README.Install version [d2eac95aca].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
The GNUPLOT source code and executables may be copied and/or modified
freely as long as the copyright messages are left intact.

See the History file for changes to GNUPLOT.

Compilation instructions are near the end of this file.

GNUPLOT has been tested on Sun3's and Sun4's (SunOS 4.0.3 and 4.1.1),
a VAX 6410 (VMS 5.2), Commodore Amiga's (KS/WB 1.3 and 2.0, Lattice C
and Aztec C beta 5.2a), IBM PC XT's and AT's (MS-DOS 3.3/5.0 BC++ 2.0/TC++
1.0), IRIS 4D/70G and 4D/25G with MIPS C, NeXT with gnu C 1.34,
DECStation 5000/200PXG (ULTRIX V4.1),
AT&T 3B1 (version 3.51m with cc and gcc 1.39),
and Apollo's (DomainOS SR10.3 BSD4.3 with C compiler 68K Rev 6.7(316)).
The code is written with portability in mind.
GNUPLOT has not been tested on Pyramid 90x and IBM PC Microsoft C.

Send your comments, suggestions, or modifications to 
  info-gnuplot@ames.arc.nasa.gov
This is a mailing list; to join it send a note to 
  info-gnuplot-request@ames.arc.nasa.gov
Send bug reports to
  bug-gnuplot@ames.arc.nasa.gov

                       PREPROCESSOR #DEFINES

These #defines should be checked before compilation (see the makefiles):
define      file            note
------      ----            --------
NOVFORK     Makefile        define if you don't have the vfork() system call
GAMMA       Makefile        define if you've got gamma(3)
MEMCPY      Makefile        define if your bcopy() is called memcpy()
MEMSET      Makefile        define if you have memset() but not bzero()
NOCOPY      Makefile        define if you've don't have a memcpy() by any name
bcopy()     plot.h          define if you've got a memcpy() by some OTHER name
                              (see example in plot.h)
PC          Makefile        define if compiling on a PClone
MSDOS       Makefile        define if compiling under MSDOS;
                              automatically defined by Microsoft C 5.10
HELPFILE    Makefile        name including path of gnuplot.gih file.
VERYLARGE   plot.h          define to be largest coordinate number.
SHELL       plot.h          default shell to spawn if SHELL environment
                              variable not found at run-time
NOCWDRC     Makefile        define to inhibit check of ./.gnuplot
READLINE    Makefile        define if you want command-line editing

Valid TERMFLAGS defines.  These defines are used to include the
various plotting terminals, printers, and protocols that a given version
of gnuplot can access:

define 	    file            note
------      ----            --------
TERMFLAGS   Makefile        the set of terminals you want, from below
            or term.h

   AED         AED 512 and AED 767
   AIFM        Adobe Illustrator Format
   AMIGASCREEN Amiga custom screen
   APOLLO      Apollo Graphics Primitive Resource (resizable window)
   ATT6300     PC with AT&T 6300 graphics
   BITGRAPH    BBN BitGraph
   CGI         SCO CGI
   CORONA      PC with Corona graphics 325
   DXY800A     Roland DXY800A plotter
   DUMB	       Printer or glass dumb terminal
   DXF	       AutoCad (Release 10.x) dxf file format
   EEPIC       EEPIC-extended LaTeX driver, for EEPIC users
   EGALIB      PC with EGA/VGA graphics.
   EMTEX       LATEX picture environment with emTeX specials
   EPS60       Epson-style 60-dot per inch printers
   EPSONP      Epson LX-800, Star NL-10, NX-1000 and lots of others
   FIG         Fig graphics language (requires object.h from TransFig)
   GPR         Apollo Graphics Primitive Resource (fixed-size window)
   HERCULES    IBM PC/Clone with Hercules graphics board
   HP2648      HP2648, HP2647
   HP26        HP2623A and maybe others
   HP75        HP7580, and probably other HPs
   HPGL        HP7475 and (hopefully) lots of others
   HPLJII      HP Laserjet II
   HPLJIII     HP Laserjet III (HPGL/2)
   IMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
   IRIS4D      IRIS4D series computer
   KERMIT      MS-Kermit Tektronix 4010 emulator
   LATEX       LATEX picture environment
   LN03P       DEC LN03P laser printer
   NEC         NEC CP6 pinwriter printer
   PBM         PBMPLUS pbm, pgm, ppm formats
   POSTSCRIPT  Postscript
   PRESCRIBE   Kyocera Laser printer
   QMS         QMS/QUIC laserprinter (Talaris 1200 and others)
   REGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
   SELANAR     Selanar
   STARC       Star Color Printer
   SUN         Sun Microsystems Workstation
   T410X       Tektronix 4106, 4107, 4109 and 420x terminals
   TANDY60     Tandy DMP-130 series 60-dot per inch graphics
   TEK         Tektronix 4010, and probably others
   UNIXPC      unixpc (ATT 3b1 or ATT 7300)
   UNIXPLOT    unixplot
   V384        Vectrix 384 and tandy color printer
   VTTEK       VT like Tektronix 4010 emulator
   X11         X11R4 window system


These #defines are defined automatically by various compilers, some
gnuplot routines check these defines to implement features found in the
various environments:

define 	      note
------        --------
AMIGA_AC_5    defined for Manx Aztec C 5.2a on the Amiga
AMIGA_LC_5_1  defined for Lattice C 5.01 on the Amiga
apollo        defined by Apollo's C compilers.
_CRAY         defined by CRAY's C compiler.
__TURBOC__    defined automatically by Turbo C 2.0, C++ 1.0, Borland C++ 2.0
unix          defined by most unix C compilers.  
vms           (and VMS) defined by VAX-11 C under VMS.
__ZTC__       Zortech C compiler under MSDOS.


                             TO COMPILE

under UNIX:  
To compile do:
  Copy makefile.unx to Makefile
      cp makefile.unx Makefile
  Look through the Makefile to see if you need to make any changes.
  See especially the HELPDEST and TERMFLAGS variables.  Edit if needed.
  Alternatively, all these variables may be set as command line arguments to
  'make'. For example:

	make <MACHINE> HELPDEST='/usr/um/misc/lib/gnuplot.gih' \
		DEST='/usr/um/misc/bin' READLINE=

  Edit term.h, to include/exclude terminals
  Type
      make
  For further instructions.
  If that works, try
      make install
  For further instructions.

under VMS:  
  To compile:
     copy makefile.vms makefile.
     make
  Or if you don't have a suitable make:
     @buildvms
  To tell gnuplot where to find the help library:
      $ define gnuplot$help disk:[directory]gnuplot.hlb
  Alternatively (and preferably) put the help in the main system help library.

under AmigaDOS:
Using Aztec C 5.2a
      make -f makefile.ami
Using Lattice C 5.1
      lmk -f makefile.amg

under MSDOS:
Using Microsoft C 5.10.
      copy makefile.msc makefile
      make makefile

Using Borland C++ 2.0, Turbo C++ 1.0
      copy makefile.tc makefile
  Edit makefile to change TC, BIN, BGI, BGIOBJ. You may also want to turn
      on overlays (See manual for more on overlays).
  Edit linkopt.tc (linkopt.tco if overlays on) to change location of
      libraries.
      make

Using Turbo C 2.0.
  As per Borland C++ 2.0. Edit linkopt.tc to change location of libraries.


The file gnuplot.gih is needed for help on the PC.
If the file gnuplot.gih is not in the default directory, then use:
    set GNUHELP={full path name of gnuplot.gih}


                         ENVIRONMENT VARIABLES

See 'help environment'.

If the environment variable GNUTERM is found, it is used as the terminal
type. Otherwise, in some cases the variable TERM will be used, or the
hardware may be automatically detected. 

The PC version looks for the environment variable GNUPLOT to contain
the name of the directory from which to load the initialization file
GNUPLOT.INI.  See the help on 'start_up' for more information.

HOME is examined as a directory where a .gnuplot startup file might be
found. See help on "start-up".

If defined, the environment variable GNUHELP is used for the name
of the .gih help file, otherwise HELPFILE (defined in makefile or 
plot.c) is used.

The VMS version looks for the logical name GNUPLOT$HELP to locate 
the help library.

The CGI drivers need the CGIPATH environment variable to set the path
to the CGI agents, and the CGIDISP and/or CGIPRNT environment
variables to set the output devices.
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































































































































































































































































































































Deleted r34.1/plot/README.NeXT version [f11c2b42b9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
	This directory contains version 2 of the additional files
you'll need to get gnuplot3.0 to display it's postscript directly to a
window instead of going through the klunky process of writing the
postscript to a file and launching Previewer to view the file.  Note
that all input is still done at the shell level! Fancier NeXTStep
interfaces will be a future project.

	This version is faster and leaner than the old method.  It
also does not eat up swap space like the older version (this was
particularly noticeable when doing animation-like plots).  To do this
I used DPS function calls instead of creating a NXImage and
compositing the stream of commands. I based my code on the program
called "epsview" in the hackkit tar file on the archive servers.

	The next_dps.trm (next terminal) is basically the post.trm
(postscript terminal) with the fprintf replaced by DPSPrintf and
outfile by the DPSContext d.  You'll also see that I also used some
code (with modifications) from David S. Joerg's MovieApp.  Using the
DPS functions enabled me to slim down the EpsViewer.[hm] and
EPSView.[hm] files.

	No claim is made to code elegance or to it being a good example of
objective-c coding.  This is my first (well, second, sort of) objective-c 
program. It seems to work for me. Any constructive criticism would be 
appreciated.  I can be reached at strobel@phast.phys.washington.edu

cheers!

nick strobel

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































Deleted r34.1/plot/README.amiga version [a9a743cf4c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
SOME NOTES ON GNUPLOT ON THE AMIGA ...



Environment Variables:

   GNUFONT   You can say "setenv GNUFONT <Fontname>/<Pointsize>" to get the font
             of your liking on the screen, e.g. "setenv GNUFONT sapphire/14".
             Otherwise gnuplot will select the default-font you chose with
             "Preferences".

   GNUHELP   Allows you to define a pathname for the GNUPlot help file.  For
             example, "setenv GNUHELP TEX:gnuplot.gih"

   GNUPLOT   Your current directory is searched for the file ".gnuplot".
             If you say "setenv GNUPLOT <Path>" (without the filename!)
             GNUPlot will look for it there.

   GNUTERM   You can define a default driver with "setenv GNUTERM <driver>".
             A good choice is "setenv GNUTERM amiga" :^)

   SHELL     If you don't like "NewShell" as your shell, you can say
             "setenv SHELL <Shell>".


Stack Size:

   Set your stack to at least 20000 and you'll be fine (I hope).
   If you're using the integral feature, a stack size of at least 70000
   is necessary (at least it is for "bivariat.demo" to execute).



--------------------------   LATTICE C VERSION   ------------------------------


Default paths/directories:

   Gnuplot looks for the file "gnuplot.gih" in your "S:"-directory unless you
   specify the full pathname including the filename via "setenv GNUHELP".


Bugs/deficiencies:

   The SAS/C 5.1 library routine [fs]scanf will not correctly handle
   format-strings like "%[^\n]s". Maybe this will be fixed by SAS in future
   versions.

   When using "%g" as format-string, SAS/C 5.1 [fs]printf will incorrectly
   output "0" as "0.". This looks rather ugly as a axis-label.


SAS/C 5.1 bugs:

   SAS/C 5.1 [fs]scanf will count parameters overread with the "%*s" format-
   string as properly matched. I included a fix for this by counting the
   "%*"-sequences in the given format-string. Therfore the "*" must immediately
   follow the "%" (I don't know if it's legal to put something in-between
   these two characters anyway...).

   If you start a shell via the gnuplot "shell"-command you won't be able to
   close your CLI/Shell again. This is probably due to an error in the
   SAS/C "system"-call.

   "isatty(fileno(stdin))" did not work correctly. A fix is included.

   SAS/C does not seem to handle float-parameters in function-calls and
   -declarations correctly. (This cost me at least 2 hours to figure out >:-( ).
   See the latex- and eepic-drivers for details.




---------------------------   AZTEC C VERSION   -------------------------------


Default paths/directories:

   GNUPlot looks for the "gnuplot.gih" file in "GNUPLOT:docs/gnuplot.gih" if
   GNUHELP is not defined.   This is defined in the makefile (makefile.ami).


Terminal Drivers:

   The Aztec C version can now use the "amiga.trm" driver written by
   Carsten Steger.  Under KS/WB 2.0, a custom screen will be used with a size
   specified by the Prefs/Overscan program.
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































Deleted r34.1/plot/README.gnutex version [aea1db01d8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
A note to former Gnutex users, from David Kotz (David.Kotz@Dartmouth.edu).
--------------------------------------------------------------------------

May 30, 1991

GNUTeX was merged with GNUPLOT beginning with GNUPLOT 2.0.  Many
aspects of gnutex 1.6 made it into GNUPLOT 2.0. Unfortunately for
those of us who have a lot of gnutex input files around, not
everything from gnutex is supported by GNUPLOT. To help gnutex users
with the process of adapting to GNUPLOT (and I recommend it), I have
included a section in the LaTeX/GNUPLOT tutorial (in ./docs/latextut/)
about the differences, and written a translator program.  Please read
the LaTeX/GNUPLOT tutorial. 

The translator was available as part of the GNUPLOT 2.0 release, but
has been removed from the standard distribution of GNUPLOT.  The
translator is now available for anonymous ftp from cs.duke.edu as
dist/sources/gnuplot/gnut2p.tar.Z. It has not changed since GNUPLOT
2.01 (ie, GNUPLOT 2.0 patchlevel 1).

Users of gnutex that did not use the LaTeX driver will probably have
little difficulty adapting. 

Please send all comments, complaints, and suggestions on this subject
to David.Kotz@Dartmouth.edu.
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































Deleted r34.1/plot/README.patch1 version [0c67fef9a4].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
This package provides the upgrade of gnuplot 3.0 to patch level 1.
Below are the contributers to this upgrade and the modifications made.

Thank you all

Gershon

----------------------------------------------------------------------------

* Subject: Y log / postscript eps fix
  Name: Russell Lang
  Email: rjl@monu1.cc.monash.edu.au

* Subject: HP26 driver to lift text.
  Name: Bruce Lueckenhoff
  Email: luechen@cis.udel.edu

* Subject: CRAY prt, UIUC coordinates.
  Name: Daniel Lewart
  Email: d-lewart@uiuc.edu

* Subject: AI device
  Name:	Ray Ghanbari
  Email: ray@mtl.mit.edu

* Subject: HP_MOTIF on a Snake, X11 for Next
  Name: Alex Woo
  Email: woo@ra-next.arc.nasa.gov

* Subject: Mod. to LaTeX for multiple curves/plots, complex atan function fix.
  Name: Ray Toy???
  Email: toy@soho.crd.ge.com

* Subject: Fix the "splot 'file.dat'" with only z values.
  Name: Gershon Elber
  Email: gershon@gr.utah.edu

* Subject: Underscore prefixed names.
  Name: Tom Tkacik
  Email: tkacik@hobbes.cs.gmr.com

* Subject: Amiga port
  Name: Carsten Steger 
  Email: stegerc@informatik.tu-muenchen.de
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































Deleted r34.1/plot/README.x11 version [2bea23893f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

Notes on the new X11 features are attached. 

Ed
----------------------------------
Ed Kubaitis (ejk@ux2.cso.uiuc.edu)
Computing & Communications Services Office - University of Illinois, Urbana

===============================================================================
Gnuplot_x11 for 3.2
-------------------

New features
------------
   o CRIPPLED_SELECT build option for SVR3 platforms with incomplete
     or faulty implementations of BSD select().

   o Xlib only

     X11 support no longer requires Athena or Motif libraries and
     include files. This makes life easier for people on platforms
     with Open Look only. It also simplifies X11 tailoring on all
     platforms. Oh yes, and the gnuplot_x11 executable is smaller
     (~43K instead of ~500K on RS/6000.)

     makefile.unx has been edited to remove references to Athena &
     Motif. Also, with the exception of the HP definition (where it
     appeared to be intentionally specific to R4) all references to 
     X11R4 have also been removed since this version should work without 
     changes on R3, R4, or R5.

   o Grayscale handling

     * grayscale displays get monochrome rendering by default

     * '-gray' option & resource forces grayscale rendering on grayscale
       or color displays.

     * '-mono' option forces monochrome rendering on color displays.

     * special grayscale resources (separate from color)

   o Miscellaneous

     * By default, the window is no longer momentarily cleared when
       a new plot is displayed. The new plot "silently" replaces the
       previous one.  I found this useful when running some of the demos, 
       such as contours.demo, where a plot "adds" a feature to
       the one before (gnuplot "movies" anyone?;-).

       However, a "-clear" command line-option and "gnuplot*clear: on"
       restores the momentary clear that was there previously.

     * Added ptx_x11 and convex_x11 machine options to makefile.unx.

     * There is an X11FLAGS option (-DOLD_SELECT) for old 4.2 BSD systems
       (such as SunOS 3.5) which don't have the FD_XXX macros that
       go with select().


A few words about CRIPPLED_SELECT
---------------------------------
I closely reviewed four different ways people had devised for dealing with 
the "select error" problem encountered on some SVR3 platforms. I had one 
such platform (Sequent Dynix/PTX) available for testing. Unfortunately 3 of 
the four ways that had been submitted did not work for PTX (which has 
problems with non-blocking I/O and Unix domain sockets as well as select). 
The fourth way worked there but it used SV STREAMS and I had no way to 
verify that it would also work on all the other platforms that encountered 
the problem.

What was done instead was to use a temporary file instead of a pipe for
gnuplot->gnuplot_x11 communication when CRIPPLED_SELECT is used. This is 
like a sledgehammer - crude but (hopefully) robust. It should work on any 
platform with open(), read(), write(), close(), unlink(), getpid(), and 
getppid().

Response time is not bad with CRIPPLED_SELECT. Timings on an RS/6000 
for all.demo (hitting RETURN as soon as a plot appears) indicate that 
CRIPPLED_SELECT only adds an average of .5 seconds to response time, 
about what one would expect given the 1 second timer used. And curiously, 
CRIPPLED_SELECT used 30% less CPU than the default mode.

Testing
-------
The new gnuplot_x11 was tested here on the following platforms:

   o IBM RS/6000 AIX 3.1.6 (IBM X11R3)
   o IBM RS/6000 AIX 3.1.6 (MIT X11R4)
   o Apollo 400s DomainOS 10.3 (Apollo X11R3)
   o Sun SPARC SunOS 4.1.1-GFX-Rev2 (X11R?)
   o Vax BSD 4.3 Reno (X11R5)
   o Vax Ultrix-32 V3.0 Rev 64 (MIT X11R4)
   o Sun 3/50 SunOS 3.5 (MIT X11R4)
   o Sun 3/60 SunOS 4.1 (MIT X11R4)
   o NeXT (X11 R?)
   o Convex C2 9.0 OS (MIT X11R5)
   o Sequent Dynix 3.1 (MIT X11R5)
   o Sequent Dynix/PTX (MIT X11R5)
   o Cray 2 - Unicos 5+?
   o Cray Y-MP - Unicos 5+?

And with the following servers:

   o NCD 19 monochrome (NCD X11R3)
   o Visual X-15 monochrome (Visual X11R4)
   o Sun 3/50 monochrome (MIT X11R4)
   o IBM XStation 120 grayscale (IBM X11R4)
   o Visual Turbo X-19 grayscale (Visual X11R4)
   o IBM XStation 120 color (IBM X11R4)
   o Sun 3/60 color (MIT X11R4)
   o IBM XStation 130 1.3 (IBM X11R4)

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































































































































































































































Deleted r34.1/plot/bitmap.c version [540c74f256].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
#ifndef lint
static char *RCSid = "$Id: bitmap.c,v 3.26 92/03/24 22:34:39 woo Exp Locker: woo $";
#endif


/* GNUPLOT - bitmap.c */
/*
 * Copyright (C) 1986, 1987, 1990, 1991, 1992   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 * 
 *   Original Software:
 *     Jyrki Yli-Nokari <jty@intrin.UUCP>
 *     Ronald J. Hartranft <rjh2@ns.cc.lehigh.edu>
 *     Russell Lang <rjl@monu1.cc.monash.edu.au>
 * 
 * Send your comments or suggestions to 
 *  info-gnuplot@ames.arc.nasa.gov.
 * This is a mailing list; to join it send a note to 
 *  info-gnuplot-request@ames.arc.nasa.gov.  
 * Send bug reports to
 *  bug-gnuplot@ames.arc.nasa.gov.
 */

/*
** General raster plotting routines.
** Raster routines written and copyrighted 1987 by
** Jyrki Yli-Nokari (jty@intrin.UUCP)
** Intrinsic, Ltd.
**
** You may use this code for anything you like as long as
** you are not selling it and the credit is given and
** this message retained.
**
*/

/* Bitmap plotting routines derived from above raster plotting routines
 * Russell Lang, 1990
 */

#include <stdio.h>
#include "plot.h"
#include "bitmap.h"

bitmap *b_p = (bitmap *)NULL;	/* global pointer to bitmap */
unsigned int b_currx, b_curry;	/* the current coordinates */
unsigned int b_xsize, b_ysize;	/* the size of the bitmap */
unsigned int b_planes;			/* number of color planes */
unsigned int b_psize;			/* size of each plane */
unsigned int b_rastermode;		/* raster mode rotates -90deg */
unsigned int b_linemask = 0xffff;	/* 16 bit mask for dotted lines */
unsigned int b_value = 1;		/* colour of lines */
unsigned int b_hchar;			/* width of characters */
unsigned int b_hbits;			/* actual bits in char horizontally */
unsigned int b_vchar;			/* height of characters */
unsigned int b_vbits;			/* actual bits in char vertically */
unsigned int b_angle;			/* rotation of text */
char_box b_font[FNT_CHARS];		/* the current font */
unsigned int b_pattern[] = {0xffff, 0x1111,
	0xffff, 0x5555, 0x3333, 0x7777, 0x3f3f, 0x0f0f, 0x5f5f};
int b_maskcount = 0;
unsigned int b_lastx, b_lasty;	/* last pixel set - used by b_line */

#define IN(i,size)  ((unsigned)i < (unsigned)size)

/* 5x9 font, bottom row first, left pixel in lsb */
char_row FAR fnt5x9[FNT_CHARS][FNT5X9_VBITS] = {
  /* */  {000000,000000,000000,000000,000000,000000,000000,000000,000000},
  /*!*/  {000000,000000,0x0004,000000,0x0004,0x0004,0x0004,0x0004,0x0004},
  /*"*/  {000000,000000,000000,000000,000000,000000,0x000a,0x000a,0x000a},
  /*#*/  {000000,000000,0x000a,0x000a,0x001f,0x000a,0x001f,0x000a,0x000a},
  /*$*/  {000000,000000,0x0004,0x000f,0x0014,0x000e,0x0005,0x001e,0x0004},
  /*%*/  {000000,000000,0x0018,0x0019,0x0002,0x0004,0x0008,0x0013,0x0003},
  /*&*/  {000000,000000,0x0016,0x0009,0x0015,0x0002,0x0005,0x0005,0x0002},
  /*'*/  {000000,000000,000000,000000,000000,0x0002,0x0004,0x0006,0x0006},
  /*(*/  {000000,000000,0x0008,0x0004,0x0002,0x0002,0x0002,0x0004,0x0008},
  /*)*/  {000000,000000,0x0002,0x0004,0x0008,0x0008,0x0008,0x0004,0x0002},
  /***/  {000000,000000,0x0004,0x0015,0x000e,0x001f,0x000e,0x0015,0x0004},
  /*+*/  {000000,000000,000000,0x0004,0x0004,0x001f,0x0004,0x0004,000000},
  /*,*/  {000000,0x0002,0x0004,0x0006,0x0006,000000,000000,000000,000000},
  /*-*/  {000000,000000,000000,000000,000000,0x001f,000000,000000,000000},
  /*.*/  {000000,000000,0x0006,0x0006,000000,000000,000000,000000,000000},
  /*-/-*/{000000,000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,000000},
  /*0*/  {000000,000000,0x000e,0x0011,0x0013,0x0015,0x0019,0x0011,0x000e},
  /*1*/  {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0006,0x0004},
  /*2*/  {000000,000000,0x001f,0x0001,0x0001,0x000e,0x0010,0x0011,0x000e},
  /*3*/  {000000,000000,0x000e,0x0011,0x0010,0x000c,0x0010,0x0011,0x000e},
  /*4*/  {000000,000000,0x0008,0x0008,0x001f,0x0009,0x000a,0x000c,0x0008},
  /*5*/  {000000,000000,0x000e,0x0011,0x0010,0x0010,0x000f,0x0001,0x001f},
  /*6*/  {000000,000000,0x000e,0x0011,0x0011,0x000f,0x0001,0x0002,0x000c},
  /*7*/  {000000,000000,0x0001,0x0001,0x0002,0x0004,0x0008,0x0010,0x001f},
  /*8*/  {000000,000000,0x000e,0x0011,0x0011,0x000e,0x0011,0x0011,0x000e},
  /*9*/  {000000,000000,0x0006,0x0008,0x0010,0x001e,0x0011,0x0011,0x000e},
  /*:*/  {000000,000000,000000,0x0006,0x0006,000000,0x0006,0x0006,000000},
  /*;*/  {000000,0x0001,0x0002,0x0006,0x0006,000000,0x0006,0x0006,000000},
  /*<*/  {000000,000000,0x0008,0x0004,0x0002,0x0001,0x0002,0x0004,0x0008},
  /*=*/  {000000,000000,000000,000000,0x001f,000000,0x001f,000000,000000},
  /*>*/  {000000,000000,0x0002,0x0004,0x0008,0x0010,0x0008,0x0004,0x0002},
  /*?*/  {000000,000000,0x0004,000000,0x0004,0x0008,0x0010,0x0011,0x000e},
  /*@*/  {000000,000000,0x000e,0x0015,0x0015,0x0016,0x0010,0x0011,0x000e},
  /*A*/  {000000,000000,0x0011,0x0011,0x001f,0x0011,0x0011,0x000a,0x0004},
  /*B*/  {000000,000000,0x000f,0x0012,0x0012,0x000e,0x0012,0x0012,0x000f},
  /*C*/  {000000,000000,0x000e,0x0011,0x0001,0x0001,0x0001,0x0011,0x000e},
  /*D*/  {000000,000000,0x000f,0x0012,0x0012,0x0012,0x0012,0x0012,0x000f},
  /*E*/  {000000,000000,0x001f,0x0001,0x0001,0x0007,0x0001,0x0001,0x001f},
  /*F*/  {000000,000000,0x0001,0x0001,0x0001,0x0007,0x0001,0x0001,0x001f},
  /*G*/  {000000,000000,0x001e,0x0011,0x0011,0x0019,0x0001,0x0001,0x001e},
  /*H*/  {000000,000000,0x0011,0x0011,0x0011,0x001f,0x0011,0x0011,0x0011},
  /*I*/  {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0004,0x000e},
  /*J*/  {000000,000000,0x000e,0x0011,0x0010,0x0010,0x0010,0x0010,0x0010},
  /*K*/  {000000,000000,0x0011,0x0009,0x0005,0x0003,0x0005,0x0009,0x0011},
  /*L*/  {000000,000000,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
  /*M*/  {000000,000000,0x0011,0x0011,0x0011,0x0015,0x0015,0x001b,0x0011},
  /*N*/  {000000,000000,0x0011,0x0011,0x0011,0x0019,0x0015,0x0013,0x0011},
  /*O*/  {000000,000000,0x000e,0x0011,0x0011,0x0011,0x0011,0x0011,0x000e},
  /*P*/  {000000,000000,0x0001,0x0001,0x0001,0x000f,0x0011,0x0011,0x000f},
  /*Q*/  {000000,0x0018,0x000e,0x0015,0x0011,0x0011,0x0011,0x0011,0x000e},
  /*R*/  {000000,000000,0x0011,0x0009,0x0005,0x000f,0x0011,0x0011,0x000f},
  /*S*/  {000000,000000,0x000e,0x0011,0x0010,0x000e,0x0001,0x0011,0x000e},
  /*T*/  {000000,000000,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x001f},
  /*U*/  {000000,000000,0x000e,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011},
  /*V*/  {000000,000000,0x0004,0x0004,0x000a,0x000a,0x0011,0x0011,0x0011},
  /*W*/  {000000,000000,0x0011,0x001b,0x0015,0x0011,0x0011,0x0011,0x0011},
  /*X*/  {000000,000000,0x0011,0x0011,0x000a,0x0004,0x000a,0x0011,0x0011},
  /*Y*/  {000000,000000,0x0004,0x0004,0x0004,0x0004,0x000a,0x0011,0x0011},
  /*Z*/  {000000,000000,0x001f,0x0001,0x0002,0x0004,0x0008,0x0010,0x001f},
  /*[*/  {000000,000000,0x000e,0x0002,0x0002,0x0002,0x0002,0x0002,0x000e},
  /*\*/  {000000,000000,000000,0x0010,0x0008,0x0004,0x0002,0x0001,000000},
  /*]*/  {000000,000000,0x000e,0x0008,0x0008,0x0008,0x0008,0x0008,0x000e},
  /*^*/  {000000,000000,000000,000000,000000,000000,0x0011,0x000a,0x0004},
  /*_*/  {000000,000000,0x001f,000000,000000,000000,000000,000000,000000},
  /*`*/  {000000,000000,000000,000000,000000,0x0008,0x0004,0x000c,0x000c},
  /*a*/  {000000,000000,0x001e,0x0011,0x001e,0x0010,0x000e,000000,000000},
  /*b*/  {000000,000000,0x000d,0x0013,0x0011,0x0013,0x000d,0x0001,0x0001},
  /*c*/  {000000,000000,0x000e,0x0011,0x0001,0x0011,0x000e,000000,000000},
  /*d*/  {000000,000000,0x0016,0x0019,0x0011,0x0019,0x0016,0x0010,0x0010},
  /*e*/  {000000,000000,0x000e,0x0001,0x001f,0x0011,0x000e,000000,000000},
  /*f*/  {000000,000000,0x0004,0x0004,0x0004,0x000e,0x0004,0x0014,0x0008},
  /*g*/  {0x000e,0x0011,0x0016,0x0019,0x0011,0x0019,0x0016,000000,000000},
  /*h*/  {000000,000000,0x0011,0x0011,0x0011,0x0013,0x000d,0x0001,0x0001},
  /*i*/  {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0006,000000,0x0004},
  /*j*/  {0x0006,0x0009,0x0008,0x0008,0x0008,0x0008,0x000c,000000,0x0008},
  /*k*/  {000000,000000,0x0009,0x0005,0x0003,0x0005,0x0009,0x0001,0x0001},
  /*l*/  {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0004,0x0006},
  /*m*/  {000000,000000,0x0015,0x0015,0x0015,0x0015,0x000b,000000,000000},
  /*n*/  {000000,000000,0x0011,0x0011,0x0011,0x0013,0x000d,000000,000000},
  /*o*/  {000000,000000,0x000e,0x0011,0x0011,0x0011,0x000e,000000,000000},
  /*p*/  {0x0001,0x0001,0x000d,0x0013,0x0011,0x0013,0x000d,000000,000000},
  /*q*/  {0x0010,0x0010,0x0016,0x0019,0x0011,0x0019,0x0016,000000,000000},
  /*r*/  {000000,000000,0x0001,0x0001,0x0001,0x0013,0x000d,000000,000000},
  /*s*/  {000000,000000,0x000f,0x0010,0x000e,0x0001,0x001e,000000,000000},
  /*t*/  {000000,000000,0x0008,0x0014,0x0004,0x0004,0x001f,0x0004,0x0004},
  /*u*/  {000000,000000,0x0016,0x0019,0x0011,0x0011,0x0011,000000,000000},
  /*v*/  {000000,000000,0x0004,0x000a,0x0011,0x0011,0x0011,000000,000000},
  /*w*/  {000000,000000,0x000a,0x0015,0x0015,0x0011,0x0011,000000,000000},
  /*x*/  {000000,000000,0x0011,0x000a,0x0004,0x000a,0x0011,000000,000000},
  /*y*/  {0x000e,0x0010,0x001e,0x0011,0x0011,0x0011,0x0011,000000,000000},
  /*z*/  {000000,000000,0x001f,0x0002,0x0004,0x0008,0x001f,000000,000000},
  /*{*/  {000000,000000,0x0008,0x0004,0x0004,0x0002,0x0004,0x0004,0x0008},
  /*|*/  {000000,000000,0x0004,0x0004,0x0004,000000,0x0004,0x0004,0x0004},
  /*}*/  {000000,000000,0x0002,0x0004,0x0004,0x0008,0x0004,0x0004,0x0002},
  /*~*/  {000000,000000,000000,000000,000000,000000,0x0008,0x0015,0x0002},
  /*DEL*/{000000,000000,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f},
};

/* 9x17 font, bottom row first, left pixel in lsb */
char_row FAR fnt9x17[FNT_CHARS][FNT9X17_VBITS] = {
  /* */  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000},
  /*!*/  {000000,000000,000000,000000,0x0010,000000,000000,000000,0x0010,
          0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010},
  /*"*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,0x0044,0x0044,0x0044,0x0044,0x0044},
  /*#*/  {000000,000000,000000,000000,0x0044,0x0044,0x0044,0x0044,0x01ff,
          0x0044,0x0044,0x0044,0x01ff,0x0044,0x0044,0x0044,0x0044},
  /*$*/  {000000,000000,000000,000000,0x0010,0x0010,0x007e,0x0091,0x0110,
          0x0090,0x007c,0x0012,0x0011,0x0112,0x00fc,0x0010,0x0010},
  /*%*/  {000000,000000,000000,000000,0x0080,0x0141,0x0081,0x0002,0x0004,
          0x0008,0x0010,0x0020,0x0040,0x0080,0x0102,0x0105,0x0002},
  /*&*/  {000000,000000,000000,000000,0x011c,0x00a2,0x0041,0x00c1,0x0141,
          0x0022,0x001c,0x0014,0x0022,0x0022,0x001c,000000,000000},
  /*'*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010},
  /*(*/  {000000,000000,000000,000000,0x0040,0x0020,0x0010,0x0008,0x0008,
          0x0004,0x0004,0x0004,0x0008,0x0008,0x0010,0x0020,0x0040},
  /*)*/  {000000,000000,000000,000000,0x0004,0x0008,0x0010,0x0020,0x0020,
          0x0040,0x0040,0x0040,0x0020,0x0020,0x0010,0x0008,0x0004},
  /***/  {000000,000000,000000,000000,0x0010,0x0010,0x0111,0x0092,0x0054,
          0x0038,0x01ff,0x0038,0x0054,0x0092,0x0111,0x0010,0x0010},
  /*+*/  {000000,000000,000000,000000,000000,000000,0x0010,0x0010,0x0010,
          0x0010,0x01ff,0x0010,0x0010,0x0010,0x0010,000000,000000},
  /*,*/  {000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010,000000,
          000000,000000,000000,000000,000000,000000,000000,000000},
  /*-*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,0x01ff,000000,000000,000000,000000,000000,000000},
  /*.*/  {000000,000000,000000,000000,0x0010,0x0038,0x0010,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000},
  /*-/-*/{000000,000000,000000,000000,000000,000000,0x0001,0x0002,0x0004,
          0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,000000,000000},
  /*0*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0103,0x0105,
          0x0109,0x0111,0x0121,0x0141,0x0181,0x0101,0x0082,0x007c},
  /*1*/  {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x0010,0x0010,0x0010,0x0010,0x001c,0x0018,0x0010},
  /*2*/  {000000,000000,000000,000000,0x01ff,0x0001,0x0001,0x0001,0x0001,
          0x0002,0x007c,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
  /*3*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
          0x0080,0x0078,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
  /*4*/  {000000,000000,000000,000000,0x0040,0x0040,0x0040,0x0040,0x0040,
          0x01ff,0x0041,0x0042,0x0044,0x0048,0x0050,0x0060,0x0040},
  /*5*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
          0x0100,0x0080,0x007f,0x0001,0x0001,0x0001,0x0001,0x01ff},
  /*6*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
          0x0081,0x007f,0x0001,0x0001,0x0001,0x0002,0x0084,0x0078},
  /*7*/  {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0002,0x0004,
          0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0100,0x01ff},
  /*8*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
          0x0082,0x007c,0x0082,0x0101,0x0101,0x0101,0x0082,0x007c},
  /*9*/  {000000,000000,000000,000000,0x001c,0x0022,0x0040,0x0080,0x0100,
          0x0100,0x01fc,0x0102,0x0101,0x0101,0x0101,0x0082,0x007c},
  /*:*/  {000000,000000,000000,000000,000000,000000,0x0010,0x0038,0x0010,
          000000,000000,000000,0x0010,0x0038,0x0010,000000,000000},
  /*;*/  {000000,000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010,
          000000,000000,000000,0x0010,0x0038,0x0010,000000,000000},
  /*<*/  {000000,000000,000000,000000,0x0040,0x0020,0x0010,0x0008,0x0004,
          0x0002,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040},
  /*=*/  {000000,000000,000000,000000,000000,000000,000000,000000,0x01ff,
          000000,000000,000000,0x01ff,000000,000000,000000,000000},
  /*>*/  {000000,000000,000000,000000,0x0004,0x0008,0x0010,0x0020,0x0040,
          0x0080,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008,0x0004},
  /*?*/  {000000,000000,000000,0x0010,0x0038,0x0010,000000,0x0010,0x0010,
          0x0020,0x0040,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
  /*@*/  {000000,000000,000000,000000,0x007c,0x0002,0x0001,0x01f9,0x0145,
          0x0145,0x0145,0x0179,0x0101,0x0101,0x0101,0x0082,0x007c},
  /*A*/  {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x01ff,
          0x0101,0x0082,0x0082,0x0044,0x0044,0x0028,0x0028,0x0010},
  /*B*/  {000000,000000,000000,000000,0x007f,0x0084,0x0104,0x0104,0x0104,
          0x0084,0x007c,0x0084,0x0104,0x0104,0x0104,0x0084,0x007f},
  /*C*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0101,0x0082,0x007c},
  /*D*/  {000000,000000,000000,000000,0x007f,0x0084,0x0104,0x0104,0x0104,
          0x0104,0x0104,0x0104,0x0104,0x0104,0x0104,0x0084,0x007f},
  /*E*/  {000000,000000,000000,000000,0x01ff,0x0001,0x0001,0x0001,0x0001,
          0x0001,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x01ff},
  /*F*/  {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
          0x0001,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x01ff},
  /*G*/  {000000,000000,000000,000000,0x00fc,0x0102,0x0101,0x0101,0x0101,
          0x0101,0x01c1,0x0001,0x0001,0x0001,0x0001,0x0102,0x00fc},
  /*H*/  {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
          0x0101,0x01ff,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
  /*I*/  {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x007c},
  /*J*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
          0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0180},
  /*K*/  {000000,000000,000000,000000,0x0101,0x0081,0x0041,0x0021,0x0011,
          0x0009,0x0005,0x000b,0x0011,0x0021,0x0041,0x0081,0x0101},
  /*L*/  {000000,000000,000000,000000,0x01ff,0x0101,0x0001,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
  /*M*/  {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
          0x0101,0x0111,0x0111,0x0129,0x0145,0x0145,0x0183,0x0101},
  /*N*/  {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0181,0x0141,
          0x0141,0x0121,0x0111,0x0109,0x0105,0x0105,0x0103,0x0101},
  /*O*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0082,0x007c},
  /*P*/  {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
          0x0001,0x007f,0x0081,0x0101,0x0101,0x0101,0x0081,0x007f},
  /*Q*/  {000000,000000,0x0180,0x0040,0x007c,0x0092,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0082,0x007c},
  /*R*/  {000000,000000,000000,000000,0x0101,0x0081,0x0041,0x0021,0x0011,
          0x0009,0x007f,0x0081,0x0101,0x0101,0x0101,0x0081,0x007f},
  /*S*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
          0x0080,0x007c,0x0002,0x0001,0x0001,0x0101,0x0082,0x007c},
  /*T*/  {000000,000000,000000,000000,0x0038,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0111,0x01ff},
  /*U*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
  /*V*/  {000000,000000,000000,000000,0x0010,0x0010,0x0028,0x0028,0x0044,
          0x0044,0x0082,0x0082,0x0101,0x0101,0x0101,0x0101,0x0101},
  /*W*/  {000000,000000,000000,000000,0x0101,0x0183,0x0145,0x0145,0x0129,
          0x0111,0x0111,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
  /*X*/  {000000,000000,000000,000000,0x0101,0x0101,0x0082,0x0082,0x0044,
          0x0028,0x0010,0x0028,0x0044,0x0082,0x0082,0x0101,0x0101},
  /*Y*/  {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x0010,0x0028,0x0044,0x0082,0x0082,0x0101,0x0101},
  /*Z*/  {000000,000000,000000,000000,0x01ff,0x0001,0x0002,0x0002,0x0004,
          0x0008,0x0010,0x0020,0x0040,0x0080,0x0080,0x0100,0x01ff},
  /*[*/  {000000,000000,000000,000000,0x007c,0x0004,0x0004,0x0004,0x0004,
          0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x007c},
  /*\*/  {000000,000000,000000,000000,000000,000000,0x0100,0x0080,0x0040,
          0x0020,0x0010,0x0008,0x0004,0x0002,0x0001,000000,000000},
  /*]*/  {000000,000000,000000,000000,0x007c,0x0040,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x007c},
  /*^*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,0x0101,0x0082,0x0044,0x0028,0x0010},
  /*_*/  {000000,000000,000000,000000,0x01ff,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000},
  /*`*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,0x0020,0x0010,0x0008,0x000c,0x001c,0x0008},
  /*a*/  {000000,000000,000000,000000,0x03fc,0x0102,0x0101,0x0102,0x01fc,
          0x0100,0x0100,0x0080,0x007c,000000,000000,000000,000000},
  /*b*/  {000000,000000,000000,000000,0x007d,0x0083,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0083,0x007d,0x0001,0x0001,0x0001,0x0001},
  /*c*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0001,0x0001,
          0x0001,0x0101,0x0082,0x007c,000000,000000,000000,000000},
  /*d*/  {000000,000000,000000,000000,0x017c,0x0182,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0182,0x017c,0x0100,0x0100,0x0100,0x0100},
  /*e*/  {000000,000000,000000,000000,0x007c,0x0002,0x0001,0x0001,0x01ff,
          0x0101,0x0101,0x0082,0x007c,000000,000000,000000,000000},
  /*f*/  {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x007c,0x0010,0x0010,0x0010,0x0110,0x00a0,0x0040},
  /*g*/  {0x007c,0x0082,0x0101,0x0100,0x017c,0x0182,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0182,0x017c,000000,000000,000000,000000},
  /*h*/  {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
          0x0103,0x0103,0x0085,0x0079,0x0001,0x0001,0x0001,0x0001},
  /*i*/  {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x0010,0x0018,000000,000000,0x0018,0x0018,000000},
  /*j*/  {0x003c,0x0042,0x0081,0x0080,0x0080,0x0080,0x0080,0x0080,0x0080,
          0x0080,0x0080,0x00c0,000000,000000,0x00c0,0x00c0,000000},
  /*k*/  {000000,000000,000000,000000,0x0082,0x0042,0x0022,0x0012,0x000a,
          0x0016,0x0022,0x0042,0x0002,0x0002,0x0002,0x0002,0x0002},
  /*l*/  {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
          0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x001c},
  /*m*/  {000000,000000,000000,000000,0x0111,0x0111,0x0111,0x0111,0x0111,
          0x0111,0x0111,0x00ab,0x0045,000000,000000,000000,000000},
  /*n*/  {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0083,0x007d,000000,000000,000000,000000},
  /*o*/  {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0082,0x007c,000000,000000,000000,000000},
  /*p*/  {0x0001,0x0001,0x0001,0x0001,0x007d,0x0003,0x0081,0x0101,0x0101,
          0x0101,0x0101,0x0083,0x007d,000000,000000,000000,000000},
  /*q*/  {0x0100,0x0100,0x0100,0x0100,0x017c,0x0182,0x0101,0x0101,0x0101,
          0x0101,0x0101,0x0182,0x017c,000000,000000,000000,000000},
  /*r*/  {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
          0x0001,0x0103,0x0085,0x0079,000000,000000,000000,000000},
  /*s*/  {000000,000000,000000,000000,0x007e,0x0081,0x0100,0x0080,0x007c,
          0x0002,0x0001,0x0102,0x00fc,000000,000000,000000,000000},
  /*t*/  {000000,000000,000000,000000,0x0040,0x00a0,0x0110,0x0010,0x0010,
          0x0010,0x0010,0x0010,0x00fe,0x0010,0x0010,0x0010,0x0010},
  /*u*/  {000000,000000,000000,000000,0x013c,0x0142,0x0181,0x0101,0x0101,
          0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
  /*v*/  {000000,000000,000000,000000,0x0010,0x0028,0x0044,0x0082,0x0101,
          0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
  /*w*/  {000000,000000,000000,000000,0x0044,0x00aa,0x0111,0x0111,0x0101,
          0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
  /*x*/  {000000,000000,000000,000000,0x0101,0x0082,0x0044,0x0028,0x0010,
          0x0028,0x0044,0x0082,0x0101,000000,000000,000000,000000},
  /*y*/  {0x007c,0x0082,0x0101,0x0100,0x0100,0x01fc,0x0102,0x0101,0x0101,
          0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
  /*z*/  {000000,000000,000000,000000,0x01ff,0x0002,0x0004,0x0008,0x0010,
          0x0020,0x0040,0x0080,0x01ff,000000,000000,000000,000000},
  /*{*/  {000000,000000,000000,000000,0x00c0,0x0020,0x0010,0x0010,0x0010,
          0x0008,0x0004,0x0008,0x0010,0x0010,0x0010,0x0020,0x00c0},
  /*|*/  {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
          000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010},
  /*}*/  {000000,000000,000000,000000,0x0006,0x0008,0x0010,0x0010,0x0010,
          0x0020,0x0040,0x0020,0x0010,0x0010,0x0010,0x0008,0x0006},
  /*~*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,0x0040,0x00a0,0x0111,0x000a,0x0004},
  /*DEL*/{000000,000000,000000,000000,0x0155,000000,0x0155,000000,0x0155,
          000000,0x0155,000000,0x0155,000000,0x0155,000000,0x0155},
};

/* 13x25 font, bottom row first, left pixel in lsb */
char_row FAR fnt13x25[FNT_CHARS][FNT13X25_VBITS] = {
  /* */  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000},
  /*!*/  {000000,000000,000000,000000,000000,0x00e0,0x00e0,0x00e0,000000,
          000000,000000,0x0040,0x0040,0x0040,0x0040,0x0040,0x00e0,0x00e0,
          0x00e0,0x00e0,0x00e0,0x00e0,0x00e0,0x00e0,0x0040},
  /*"*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000,000000,
          0x0208,0x0208,0x0208,0x0208,0x0208,0x0208,0x0208},
  /*#*/  {000000,000000,000000,000000,000000,000000,0x0208,0x0208,0x0208,
          0x0208,0x0208,0x0208,0x1fff,0x0208,0x0208,0x0208,0x0208,0x0208,
          0x1fff,0x0208,0x0208,0x0208,0x0208,0x0208,0x0208},
  /*$*/  {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
          0x03f8,0x0444,0x0842,0x0840,0x0840,0x0440,0x03f8,0x0044,0x0042,
          0x0042,0x0842,0x0444,0x03f8,0x0040,0x0040,0x0040},
  /*%*/  {000000,000000,000000,000000,000000,000000,0x0c00,0x1200,0x1201,
          0x0c01,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
          0x0200,0x0400,0x0800,0x1006,0x1009,0x0009,0x0006},
  /*&*/  {000000,000000,000000,000000,000000,000000,0x1078,0x1084,0x0902,
          0x0601,0x0601,0x0901,0x1081,0x0042,0x0024,0x0018,0x0018,0x0024,
          0x0042,0x0042,0x0042,0x0042,0x0024,0x0018,000000},
  /*'*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,0x0001,0x0002,0x0004,0x0008,
          0x0010,0x0030,0x0078,0x0078,0x0078,0x0030,000000},
  /*(*/  {000000,000000,000000,000000,000000,000000,0x0080,0x0040,0x0020,
          0x0020,0x0010,0x0008,0x0008,0x0004,0x0004,0x0004,0x0004,0x0004,
          0x0008,0x0008,0x0010,0x0020,0x0020,0x0040,0x0080},
  /*)*/  {000000,000000,000000,000000,000000,000000,0x0020,0x0040,0x0080,
          0x0080,0x0100,0x0200,0x0200,0x0400,0x0400,0x0400,0x0400,0x0400,
          0x0200,0x0200,0x0100,0x0080,0x0080,0x0040,0x0020},
  /***/  {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
          0x1041,0x0842,0x0444,0x0248,0x0150,0x00e0,0x1fff,0x00e0,0x0150,
          0x0248,0x0444,0x0842,0x1041,0x0040,0x0040,0x0040},
  /*+*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x1fff,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,000000,000000,000000},
  /*,*/  {000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0030,0x0078,
          0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000},
  /*-*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,0x1fff,000000,000000,
          000000,000000,000000,000000,000000,000000,000000},
  /*.*/  {000000,000000,000000,000000,000000,000000,000000,0x0038,0x007c,
          0x007c,0x007c,0x0038,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000},
  /*-/-*/{000000,000000,000000,000000,000000,000000,000000,000000,0x0001,
          0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
          0x0200,0x0400,0x0800,0x1000,0x1000,000000,000000},
  /*0*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1003,0x1005,0x1009,0x1011,0x1021,0x1041,0x1081,0x1101,
          0x1201,0x1401,0x1801,0x1001,0x0802,0x0404,0x03f8},
  /*1*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0048,0x0070,0x0060,0x0040},
  /*2*/  {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0002,0x03fc,0x0400,0x0800,0x1000,
          0x1000,0x1000,0x1000,0x1001,0x0802,0x0404,0x03f8},
  /*3*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1000,0x1000,0x1000,0x0800,0x0400,0x03e0,0x0400,0x0800,
          0x1000,0x1000,0x1000,0x1001,0x0802,0x0404,0x03f8},
  /*4*/  {000000,000000,000000,000000,000000,000000,0x0200,0x0200,0x0200,
          0x0200,0x0200,0x0200,0x0200,0x1fff,0x0201,0x0201,0x0202,0x0204,
          0x0208,0x0210,0x0220,0x0240,0x0280,0x0300,0x0200},
  /*5*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1000,0x1000,0x1000,0x1000,0x1000,0x0800,0x0400,0x03ff,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
  /*6*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff,0x0001,0x0001,
          0x0001,0x0001,0x0002,0x0004,0x0808,0x0410,0x03e0},
  /*7*/  {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
          0x0002,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
          0x0200,0x0400,0x0800,0x0800,0x1000,0x1000,0x1fff},
  /*8*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8,0x0404,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
  /*9*/  {000000,000000,000000,000000,000000,000000,0x00f8,0x0104,0x0202,
          0x0400,0x0800,0x1000,0x1000,0x1000,0x1000,0x1ff8,0x1004,0x1002,
          0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
  /*:*/  {000000,000000,000000,000000,000000,000000,000000,000000,0x0030,
          0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
          0x0030,0x0078,0x0078,0x0030,000000,000000,000000},
  /*;*/  {000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0030,0x0078,
          0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
          0x0030,0x0078,0x0078,0x0030,000000,000000,000000},
  /*<*/  {000000,000000,000000,000000,000000,000000,0x0200,0x0100,0x0080,
          0x0040,0x0020,0x0010,0x0008,0x0004,0x0002,0x0001,0x0002,0x0004,
          0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200},
  /*=*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,0x1fff,000000,000000,000000,000000,000000,
          0x1fff,000000,000000,000000,000000,000000,000000},
  /*>*/  {000000,000000,000000,000000,000000,000000,0x0008,0x0010,0x0020,
          0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,0x1000,0x0800,0x0400,
          0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008},
  /*?*/  {000000,000000,000000,000000,000000,0x0040,0x00e0,0x0040,000000,
          000000,000000,0x0040,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,
          0x1000,0x1000,0x1001,0x1001,0x0802,0x0404,0x03f8},
  /*@*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0002,
          0x0001,0x0001,0x0ee1,0x1111,0x1111,0x1111,0x1111,0x1111,0x12e1,
          0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
  /*A*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1fff,0x1001,0x1001,0x1001,0x1001,0x0802,
          0x0802,0x0404,0x0208,0x0110,0x00a0,0x00a0,0x0040},
  /*B*/  {000000,000000,000000,000000,000000,000000,0x03ff,0x0408,0x0808,
          0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03f8,0x0408,0x0808,
          0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03ff},
  /*C*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,0x03f8},
  /*D*/  {000000,000000,000000,000000,000000,000000,0x03ff,0x0408,0x0808,
          0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,
          0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03ff},
  /*E*/  {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x007f,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
  /*F*/  {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x007f,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
  /*G*/  {000000,000000,000000,000000,000000,000000,0x0ff8,0x1004,0x1002,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1f01,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0002,0x1004,0x0ff8},
  /*H*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1fff,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
  /*I*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x03f8},
  /*J*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
          0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1e00},
  /*K*/  {000000,000000,000000,000000,000000,000000,0x1001,0x0801,0x0401,
          0x0201,0x0101,0x0081,0x0041,0x0021,0x0011,0x000f,0x0009,0x0011,
          0x0021,0x0041,0x0081,0x0101,0x0201,0x0401,0x0801},
  /*L*/  {000000,000000,000000,000000,000000,000000,0x1fff,0x1001,0x1001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
  /*M*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1041,0x1041,0x10a1,
          0x10a1,0x1111,0x1209,0x1209,0x1405,0x1803,0x1001},
  /*N*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x1001,0x1801,0x1401,0x1201,0x1201,0x1101,0x1081,0x1041,0x1041,
          0x1021,0x1011,0x1009,0x1009,0x1005,0x1003,0x1001},
  /*O*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
  /*P*/  {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x03ff,0x0401,0x0801,
          0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff},
  /*Q*/  {000000,000000,000000,000000,0x0c00,0x0200,0x03f8,0x0494,0x0862,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
  /*R*/  {000000,000000,000000,000000,000000,000000,0x1001,0x0801,0x0401,
          0x0201,0x0101,0x0081,0x0041,0x0021,0x0011,0x03ff,0x0401,0x0801,
          0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff},
  /*S*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1000,0x1000,0x1000,0x0800,0x0400,0x03f8,0x0004,0x0002,
          0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,0x03f8},
  /*T*/  {000000,000000,000000,000000,000000,000000,0x00e0,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x1041,0x1fff},
  /*U*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
  /*V*/  {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x00a0,
          0x00a0,0x0110,0x0110,0x0208,0x0208,0x0404,0x0404,0x0802,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
  /*W*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1803,
          0x1405,0x1405,0x1209,0x1209,0x1111,0x1111,0x10a1,0x1041,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
  /*X*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x0802,0x0802,0x0404,0x0208,0x0110,0x00a0,0x0040,0x00a0,0x0110,
          0x0208,0x0404,0x0802,0x0802,0x1001,0x1001,0x1001},
  /*Y*/  {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x00a0,0x0110,0x0208,
          0x0404,0x0802,0x0802,0x1001,0x1001,0x1001,0x1001},
  /*Z*/  {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
          0x0002,0x0004,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
          0x0200,0x0400,0x0400,0x0800,0x1000,0x1000,0x1fff},
  /*[*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0008,0x0008,
          0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,
          0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x03f8},
  /*\*/  {000000,000000,000000,000000,000000,000000,000000,000000,0x1000,
          0x1000,0x0800,0x0400,0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,
          0x0008,0x0004,0x0002,0x0001,0x0001,000000,000000},
  /*]*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0200,0x0200,
          0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
          0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x03f8},
  /*^*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000,000000,
          0x1001,0x0802,0x0404,0x0208,0x0110,0x00a0,0x0040},
  /*_*/  {000000,000000,000000,000000,000000,000000,0x1fff,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000},
  /*`*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,0x0400,0x0200,0x0100,0x0080,
          0x0040,0x0060,0x00f0,0x00f0,0x00f0,0x0060,000000},
  /*a*/  {000000,000000,000000,000000,000000,000000,0x17f8,0x0804,0x0802,
          0x0802,0x0802,0x0804,0x0ff8,0x0800,0x0800,0x0800,0x0800,0x0404,
          0x03f8,000000,000000,000000,000000,000000,000000},
  /*b*/  {000000,000000,000000,000000,000000,000000,0x03f9,0x0405,0x0803,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
          0x03f9,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
  /*c*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,
          0x03f8,000000,000000,000000,000000,000000,000000},
  /*d*/  {000000,000000,000000,000000,000000,000000,0x13f8,0x1404,0x1802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
          0x13f8,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000},
  /*e*/  {000000,000000,000000,000000,000000,000000,0x0ff8,0x0004,0x0002,
          0x0001,0x0001,0x0001,0x1fff,0x1001,0x1001,0x1001,0x0802,0x0404,
          0x03f8,000000,000000,000000,000000,000000,000000},
  /*f*/  {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x03f8,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x1040,0x0880,0x0500,0x0200},
  /*g*/  {0x03f8,0x0404,0x0802,0x1001,0x1000,0x1000,0x13f8,0x1404,0x1802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
          0x13f8,000000,000000,000000,000000,000000,000000},
  /*h*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
          0x03f9,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
  /*i*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0070,
          000000,000000,000000,0x00e0,0x00e0,0x00e0,000000},
  /*j*/  {0x00f0,0x0108,0x0204,0x0402,0x0400,0x0400,0x0400,0x0400,0x0400,
          0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0700,
          000000,000000,000000,0x0700,0x0700,0x0700,000000},
  /*k*/  {000000,000000,000000,000000,000000,000000,0x0804,0x0404,0x0204,
          0x0104,0x0084,0x0044,0x0024,0x0014,0x002c,0x0044,0x0084,0x0104,
          0x0204,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004},
  /*l*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0070},
  /*m*/  {000000,000000,000000,000000,000000,000000,0x1041,0x1041,0x1041,
          0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x08a3,0x0515,
          0x0209,000000,000000,000000,000000,000000,000000},
  /*n*/  {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
          0x03f9,000000,000000,000000,000000,000000,000000},
  /*o*/  {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,
          0x03f8,000000,000000,000000,000000,000000,000000},
  /*p*/  {0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x03f9,0x0405,0x0803,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
          0x03f9,000000,000000,000000,000000,000000,000000},
  /*q*/  {0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x13f8,0x1404,0x1802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
          0x13f8,000000,000000,000000,000000,000000,000000},
  /*r*/  {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
          0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1001,0x0803,0x0405,
          0x03f9,000000,000000,000000,000000,000000,000000},
  /*s*/  {000000,000000,000000,000000,000000,000000,0x03fc,0x0402,0x0800,
          0x0800,0x0800,0x0400,0x03f8,0x0004,0x0002,0x0002,0x0002,0x0804,
          0x07f8,000000,000000,000000,000000,000000,000000},
  /*t*/  {000000,000000,000000,000000,000000,000000,0x0200,0x0500,0x0880,
          0x1040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
          0x07fc,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040},
  /*u*/  {000000,000000,000000,000000,000000,000000,0x13f8,0x1404,0x1802,
          0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,000000,000000,000000,000000,000000,000000},
  /*v*/  {000000,000000,000000,000000,000000,000000,0x0040,0x00a0,0x0110,
          0x0208,0x0404,0x0802,0x0802,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,000000,000000,000000,000000,000000,000000},
  /*w*/  {000000,000000,000000,000000,000000,000000,0x0208,0x0514,0x08a2,
          0x08a2,0x1041,0x1041,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,000000,000000,000000,000000,000000,000000},
  /*x*/  {000000,000000,000000,000000,000000,000000,0x1001,0x0802,0x0404,
          0x0208,0x0110,0x00a0,0x0040,0x00a0,0x0110,0x0208,0x0404,0x0802,
          0x1001,000000,000000,000000,000000,000000,000000},
  /*y*/  {0x03f8,0x0404,0x0802,0x1001,0x1000,0x1000,0x1000,0x1000,0x1ff8,
          0x1004,0x1002,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
          0x1001,000000,000000,000000,000000,000000,000000},
  /*z*/  {000000,000000,000000,000000,000000,000000,0x1fff,0x0002,0x0004,
          0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,
          0x1fff,000000,000000,000000,000000,000000,000000},
  /*{*/  {000000,000000,000000,000000,000000,000000,0x0600,0x0100,0x0080,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0020,0x0010,0x0020,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0080,0x0100,0x0600},
  /*|*/  {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
          0x0040,0x0040,0x0040,0x0040,000000,000000,000000,000000,000000,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040},
  /*}*/  {000000,000000,000000,000000,000000,000000,0x000c,0x0010,0x0020,
          0x0040,0x0040,0x0040,0x0040,0x0040,0x0080,0x0100,0x0080,0x0040,
          0x0040,0x0040,0x0040,0x0040,0x0020,0x0010,0x000c},
  /*~*/  {000000,000000,000000,000000,000000,000000,000000,000000,000000,
          000000,000000,000000,000000,000000,000000,000000,000000,000000,
          0x0600,0x0900,0x1080,0x1041,0x0021,0x0012,0x000c},
  /*DEL*/{000000,000000,000000,000000,000000,000000,0x1249,000000,000000,
          0x1249,000000,000000,0x1249,000000,000000,0x1249,000000,000000,
          0x1249,000000,000000,0x1249,000000,000000,0x1249},
};

/*
** The plotting area is defined as a huge bitmap.
** The bitmap is stored in a dynamically allocated pixel array b_p
**
** The bitmap is allocated (and initialized to zero) with
** b_makebitmap(xsize, ysize, planes)
** and freed with b_freebitmap()
** xsize and ysize will be rounded up to a multiple of 8.
**
** Valid (int) coordinates range from zero to (xsize-1,ysize-1)
**
** Plotting is done via b_move(x, y) and b_vector(x, y) functions,
** where the point (x,y) is the target to go from the current point
** To set the color use b_setvalue(value) where value is the value 
** (0 or 1 or a color number) to be stored in every pixel.
** To get dotted line styles, use b_setlinetype(linetype).
**
** Internally all plotting goes through b_setpixel(x, y, value).
*/


/*
** set pixel (x, y, value) to value value (this can be 1/0 or a color number).
*/
void
b_setpixel(x, y, value)
unsigned int x, y, value;
{
  register unsigned int row;
  register unsigned char mask;
  int i;
  if (b_rastermode) {
	/* interchange so that new (x,y) is old (y,b_ysize-1-x) */
	row = x;  /* temp storage */
	x = y;
	y = b_ysize-1-row;
  }
  if (IN(x, b_xsize) && IN(y, b_ysize))
  {
    row = y/8;
    mask = 1<<(y%8);

	for (i=0; i<b_planes; i++) {
		if (value&1)
			*((*b_p)[row]+x) |= mask;
		else
			*((*b_p)[row]+x) &= ~mask;
		row += b_psize;
		value >>= 1;
	}
  }
#ifdef BITMAPDEBUG
  else
  {
    if (b_rastermode)
      fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n", 
		b_ysize-1-y, x, value);
    else
      fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n",
		x, y, value);
  }
#endif
}

/*
** get pixel (x,y) value----unused
*/
/****************************
unsigned int
b_getpixel(x, y)
unsigned int x, y;
{
  register unsigned int row;
  register unsigned char mask;
  register unsigned char value;
  int i;

  if (b_rastermode) {
	row = x;
	x = y;
	y = b_ysize-1-row;
  }
  if (IN(x, b_xsize) && IN(y, b_ysize))
  {
    row = y/8 + (b_planes-1)*b_psize;
    mask = 1<<(y%8);

	for (i=0; i<b_planes; i++) {
		if ( *((*b_p)[row]+x) & mask )
			value |= 1;
		row -= b_psize;
		value <<= 1;
	}
    return(value);
  }
  else
  {
#ifdef BITMAPDEBUG
    if (b_rastermode)
      fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n",
		b_ysize-1-y, x);
    else
      fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n", x, y);
#endif
    return(0);
  }
}
********************************/

/*
** allocate the bitmap
*/
void
b_makebitmap(x, y, planes)
unsigned int x, y, planes;
{
  register unsigned j;
  unsigned rows;

  x = 8 * (unsigned int)(x/8.0+0.9);	/* round up to multiple of 8 */
  y = 8 * (unsigned int)(y/8.0+0.9);	/* round up to multiple of 8 */
  b_psize = y/8;					/* size of each plane */
  rows = b_psize * planes;			/* total number of rows of 8 pixels high */
  b_xsize = x; b_ysize = y;
  b_currx = b_curry = 0;
  b_planes = planes;
  b_value = 1;
  b_angle = 0;
  b_rastermode = 0;
  /* allocate row pointers */
  b_p = (bitmap *)alloc( rows * sizeof(pixels *), "bitmap row buffer");
  bzero(b_p, rows * sizeof(pixels *));
  for (j = 0; j < rows; j++) {
    /* allocate bitmap buffers */
    (*b_p)[j] = (pixels *)alloc(x * sizeof(pixels),(char *)NULL);
    if ((*b_p)[j] == (pixels *)NULL) {
		b_freebitmap();  /* free what we have already allocated */
		int_error("out of memory for bitmap buffer", NO_CARET);
	}
    bzero((*b_p)[j], x * sizeof(pixels));
  }
}
  
/*
** free the allocated bitmap
*/
void
b_freebitmap()
{
  int j;
  unsigned rows;

  rows = b_psize * b_planes;   /* total number of rows of 8 pixels high */
  for (j = 0; j < rows; j++)
  {
    (void) free((char *)(*b_p)[j]);
  }
  (void) free((char *)b_p);
  b_p = (bitmap *)(NULL);
}

/*
** set pixel at (x,y) with color b_value and dotted mask b_linemask.
*/
void
b_setmaskpixel(x,y,value)
unsigned int x,y,value;
{
	/* dotted line generator */
	if ((b_linemask>>b_maskcount)&(unsigned int)(1)) {
		b_setpixel(x,y,value);
	}
	b_maskcount= (b_maskcount+1) % 16;
	b_lastx= x;  /* last pixel set with mask */
	b_lasty= y;
}

/*
** draw a line from (x1,y1) to (x2,y2)
** with color b_value and dotted mask b_linemask.
*/
void
b_line(x1,y1,x2,y2)
unsigned int x1,y1,x2,y2;
{
int runcount;
int dx,dy;
int xinc,yinc;
unsigned int xplot,yplot;

	runcount=0;
	dx = abs((int)(x1)-(int)(x2));
	if (x2>x1)  xinc=  1;
	if (x2==x1) xinc=  0;
	if (x2<x1)  xinc= -1;
	dy = abs((int)(y1)-(int)(y2));
	if (y2>y1)  yinc=  1;
	if (y2==y1) yinc=  0;
	if (y2<y1)  yinc= -1;
	xplot=x1;
	yplot=y1;
	if (dx>dy) {
		/* iterate x */
		if ( (b_linemask==0xffff) ||
			((xplot!=b_lastx) && (yplot!=b_lasty)) )
			b_setmaskpixel(xplot,yplot,b_value);
		while (xplot!=x2) {
			xplot+=xinc;
			runcount+=dy;
			if (runcount>=(dx-runcount)) {
				yplot+=yinc;
				runcount-=dx;
			}
			b_setmaskpixel(xplot,yplot,b_value);
		}
	} else {
		/* iterate y */
		if ( (b_linemask==0xffff) ||
			((xplot!=b_lastx) && (yplot!=b_lasty)) )
			b_setmaskpixel(xplot,yplot,b_value);
		while (yplot!=y2) {
			yplot+=yinc;
			runcount+=dx;
			if (runcount>=(dy-runcount)) {
				xplot+=xinc;
				runcount-=dy;
			}
			b_setmaskpixel(xplot,yplot,b_value);
		}
	}
}

/*
** set character size
*/
void
b_charsize(size)
unsigned int size;
{
	int j;
	switch(size) {
		case FNT5X9:
			b_hchar = FNT5X9_HCHAR;
			b_hbits = FNT5X9_HBITS;
			b_vchar = FNT5X9_VCHAR;
			b_vbits = FNT5X9_VBITS;
			for (j = 0; j < FNT_CHARS; j++ )
				b_font[j] = &fnt5x9[j][0];
			break;
		case FNT9X17:
			b_hchar = FNT9X17_HCHAR;
			b_hbits = FNT9X17_HBITS;
			b_vchar = FNT9X17_VCHAR;
			b_vbits = FNT9X17_VBITS;
			for (j = 0; j < FNT_CHARS; j++ )
				b_font[j] = &fnt9x17[j][0];
			break;
		case FNT13X25:
			b_hchar = FNT13X25_HCHAR;
			b_hbits = FNT13X25_HBITS;
			b_vchar = FNT13X25_VCHAR;
			b_vbits = FNT13X25_VBITS;
			for (j = 0; j < FNT_CHARS; j++ )
				b_font[j] = &fnt13x25[j][0];
			break;
		default:
			int_error("Unknown character size",NO_CARET);
	}
}


/*
** put characater c at (x,y) rotated by angle with color b_value.
*/
void
b_putc(x,y,c,angle)
unsigned int x,y;
char c;
unsigned int angle;
{
	unsigned int i, j, k;
	char_row fc;

	j = c - ' ';
	for ( i = 0; i < b_vbits; i++ ) {
		fc = *( b_font[j] + i );
		if ( c == '_' ) {	/* treat underline specially */
			if ( fc  ) {	/* this this the underline row ? *?
				/* draw the under line for the full h_char width */
				for ( k = ( b_hbits - b_hchar )/2;
					k < ( b_hbits + b_hchar )/2; k++ ) {
					switch(angle) {
						case 0 : b_setpixel(x+k+1,y+i,b_value);
							break;
						case 1 : b_setpixel(x-i,y+k+1,b_value);
							break;
					}
				}
			}
		}
		else {
			/* draw character */
			for ( k = 0; k < b_hbits; k++ ) {
				if ( ( fc >> k ) & 1 ) {
					switch(angle) {
						case 0 : b_setpixel(x+k+1,y+i,b_value);
							break;
						case 1 : b_setpixel(x-i,y+k+1,b_value);
							break;
					}
				}
			}
		}
	}
}


/*
** set b_linemask to b_pattern[linetype]
*/
int
b_setlinetype(linetype)
int linetype;
{
	if (linetype>=7)
		linetype %= 7;
	b_linemask = b_pattern[linetype+2];
	b_maskcount=0;
}

/*
** set b_value to value
*/
void
b_setvalue(value)
unsigned int value;
{
	b_value = value;
}

/*
** move to (x,y)
*/
int
b_move(x, y)
unsigned int x, y;
{
  b_currx = x;
  b_curry = y;
}

/*
** draw to (x,y) with color b_value
*/
int
b_vector(x, y)
unsigned int x, y;
{
  b_line(b_currx, b_curry, x, y);
  b_currx = x;
  b_curry = y;
}


/*
** put text str at (x,y) with color b_value and rotation b_angle
*/
int
b_put_text(x,y,str)
unsigned int x, y;
char *str;
{
	if (b_angle == 1)
		x += b_vchar/2;
	else
		y -= b_vchar/2;
   switch (b_angle) {
      case 0:
	 for (; *str; ++str, x += b_hchar)
	    b_putc (x, y, *str, b_angle);
					break;
      case 1:
	 for (; *str; ++str, y += b_hchar)
	    b_putc (x, y, *str, b_angle);
					break;
	}
}


int
b_text_angle(ang)
int ang;
{
	b_angle=(unsigned int)ang;
	return TRUE;
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/bitmap.h version [e8177ee6a9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * $Id: bitmap.h,v 3.26 92/03/24 22:34:16 woo Exp Locker: woo $
 */

/* bitmap.h */

#ifdef __TURBOC__
#define FAR far
#else
#define FAR
#endif

/* allow up to 16 bit width for character array */
typedef unsigned int char_row;
typedef char_row * FAR char_box;

#define FNT_CHARS   96      /* Number of characters in the font set */

#define FNT5X9 0
#define FNT5X9_VCHAR 11 /* vertical spacing between characters */
#define FNT5X9_VBITS 9 /* actual number of rows of bits per char */
#define FNT5X9_HCHAR 7 /* horizontal spacing between characters */
#define FNT5X9_HBITS 5 /* actual number of bits per row per char */
extern char_row FAR fnt5x9[FNT_CHARS][FNT5X9_VBITS];

#define FNT9X17 1
#define FNT9X17_VCHAR 21 /* vertical spacing between characters */
#define FNT9X17_VBITS 17 /* actual number of rows of bits per char */
#define FNT9X17_HCHAR 13 /* horizontal spacing between characters */
#define FNT9X17_HBITS 9 /* actual number of bits per row per char */
extern char_row FAR fnt9x17[FNT_CHARS][FNT9X17_VBITS];

#define FNT13X25 2
#define FNT13X25_VCHAR 31 /* vertical spacing between characters */
#define FNT13X25_VBITS 25 /* actual number of rows of bits per char */
#define FNT13X25_HCHAR 19 /* horizontal spacing between characters */
#define FNT13X25_HBITS 13 /* actual number of bits per row per char */
extern char_row FAR fnt13x25[FNT_CHARS][FNT13X25_VBITS];


typedef unsigned char pixels;  /* the type of one set of 8 pixels in bitmap */
typedef pixels *bitmap[];  /* the bitmap */

extern bitmap *b_p;						/* global pointer to bitmap */
extern unsigned int b_currx, b_curry;	/* the current coordinates */
extern unsigned int b_xsize, b_ysize;	/* the size of the bitmap */
extern unsigned int b_planes;			/* number of color planes */
extern unsigned int b_psize;			/* size of each plane */
extern unsigned int b_rastermode;		/* raster mode rotates -90deg */
extern unsigned int b_linemask;			/* 16 bit mask for dotted lines */
extern unsigned int b_value;			/* colour of lines */
extern unsigned int b_hchar;			/* width of characters */
extern unsigned int b_hbits;			/* actual bits in char horizontally */
extern unsigned int b_vchar;			/* height of characters */
extern unsigned int b_vbits;			/* actual bits in char vertically */
extern unsigned int b_angle;			/* rotation of text */
extern char_box b_font[FNT_CHARS];		/* the current font */
extern unsigned int b_pattern[];
extern int b_maskcount;
extern unsigned int b_lastx, b_lasty;	/* last pixel set - used by b_line */


extern void b_makebitmap();
extern void b_freebitmap();
extern void b_setpixel();
extern unsigned int b_getpixel();
extern void b_line();
extern void b_setmaskpixel();
extern void b_putc();
extern void b_charsize();
extern void b_setvalue();

extern int b_setlinetype();
extern int b_move();
extern int b_vector();
extern int b_put_text();
extern int b_text_angle();

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































Deleted r34.1/plot/buildvms.com version [a3ff70c597].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$ ! buildvms.com  (Command file to compile/link gnuplot and doc2hlp)
$ CFLAGS = "/NOOP/define=(NOGAMMA,MEMSET)"
$ !TERMFLAGS = "/define=()"
$ TERMFLAGS = ""
$ set verify
$ cc 'CFLAGS' bitmap.c
$ cc 'CFLAGS' command.c
$ cc 'CFLAGS' contour.c
$ cc 'CFLAGS' eval.c
$ cc 'CFLAGS' graphics.c
$ cc 'CFLAGS' graph3d.c
$ cc 'CFLAGS' internal.c
$ cc 'CFLAGS' misc.c
$ cc 'CFLAGS' parse.c
$ cc 'CFLAGS' plot.c
$ cc 'CFLAGS' scanner.c
$ cc 'CFLAGS' setshow.c
$ cc 'CFLAGS' standard.c
$ cc 'CFLAGS' 'TERMFLAGS' term.c
$ cc 'CFLAGS' util.c
$ cc 'CFLAGS' version.c
$ link /exe=gnuplot -
   bitmap.obj,command.obj,contour.obj,eval.obj,graphics.obj,graph3d.obj, -
   internal.obj,misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
   standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
$ cc [.docs]doc2hlp.c
$ link doc2hlp,linkopt.vms/opt
$ @[.docs]doc2hlp.com
$ library/create/help gnuplot.hlb gnuplot.hlp
$ set noverify
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































Deleted r34.1/plot/command.c version [54411f3cdb].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
#ifndef lint
static char *RCSid = "$Id: command.c,v 3.26 92/03/24 22:34:17 woo Exp Locker: woo $";
#endif

/* GNUPLOT - command.c */
/*
 * Copyright (C) 1986, 1987, 1990, 1991, 1992   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 * 
 *   Original Software:
 *     Thomas Williams,  Colin Kelley.
 * 
 *   Gnuplot 2.0 additions:
 *       Russell Lang, Dave Kotz, John Campbell.
 *
 *   Gnuplot 3.0 additions:
 *       Gershon Elber and many others.
 * 
 * Send your comments or suggestions to 
 *  info-gnuplot@ames.arc.nasa.gov.
 * This is a mailing list; to join it send a note to 
 *  info-gnuplot-request@ames.arc.nasa.gov.  
 * Send bug reports to
 *  bug-gnuplot@ames.arc.nasa.gov.
 */

#include <stdio.h>
#include <math.h>

#ifdef AMIGA_AC_5
#include <time.h>
void sleep();		/* defined later */
#endif

#ifdef MSDOS
#include <process.h>

#ifdef __ZTC__
#define P_WAIT 0
#include <time.h>	/* usleep() */
#else

#ifdef __TURBOC__
#include <dos.h>	/* sleep() */
#include <conio.h>
extern unsigned _stklen = 16394;	/* increase stack size */

#else	/* must be MSC */
#include <time.h>	/* kludge to provide sleep() */
void sleep();		/* defined later */
#endif /* TURBOC */
#endif /* ZTC */

#endif /* MSDOS */

#ifdef AMIGA_LC_5_1
#include <proto/dos.h>
void sleep();
#endif	/* AMIGA_LC_5_1 */

#include "plot.h"
#include "setshow.h"
#include "help.h"

#ifndef STDOUT
#define STDOUT 1
#endif

#ifndef HELPFILE
#ifdef AMIGA_LC_5_1
#define HELPFILE "S:gnuplot.gih"
#else
#define HELPFILE "docs/gnuplot.gih" /* changed by makefile */
#endif /* AMIGA_LC_5_1 */
#endif /* HELPFILE */

#define inrange(z,min,max) ((min<max) ? ((z>=min)&&(z<=max)) : ((z>=max)&&(z<=min)) )

/*
 * instead of <strings.h>
 */

extern char *gets(),*getenv();
extern char *strcpy(),*strncpy(),*strcat();
extern int strlen(), strcmp();

/*
 * Only reference to contours library.
 */
extern struct gnuplot_contours *contour();

#if defined(unix) && !defined(hpux)
#ifdef GETCWD
extern char *getcwd();	/* some Unix's use getcwd */
#else
extern char *getwd();	/* most Unix's use getwd */
#endif
#else
extern char *getcwd();	/* Turbo C, MSC and VMS use getcwd */
#endif

#ifdef vms
int vms_vkid; /* Virtual keyboard id */
#endif

#ifdef unix
extern FILE *popen();
static BOOLEAN pipe_open=FALSE;
#endif

extern int chdir();

extern double magnitude(),angle(),real(),imag();
extern struct value *const_express(), *pop(), *complex();
extern struct at_type *temp_at(), *perm_at();
extern struct udft_entry *add_udf();
extern struct udvt_entry *add_udv();
extern void squash_spaces();
extern void lower_case();

/* local functions */
static enum coord_type adjustlog();

extern BOOLEAN interactive;	/* from plot.c */

/* input data, parsing variables */
struct lexical_unit token[MAX_TOKENS];
char input_line[MAX_LINE_LEN+1] = "";
int num_tokens, c_token;
int inline_num = 0;			/* input line number */

char c_dummy_var[MAX_NUM_VAR][MAX_ID_LEN+1];	/* current dummy vars */

/* the curves/surfaces of the plot */
struct curve_points *first_plot = NULL;
struct surface_points *first_3dplot = NULL;
static struct udft_entry plot_func;
struct udft_entry *dummy_func;

/* support for replot command */
char replot_line[MAX_LINE_LEN+1] = "";
static int plot_token;					/* start of 'plot' command */

/* If last plot was a 3d one. */
BOOLEAN is_3d_plot = FALSE;

com_line()
{
	read_line(PROMPT);

	/* So we can flag any new output: if false at time of error, */
	/* we reprint the command line before printing caret. */
	/* TRUE for interactive terminals, since the command line is typed. */
	/* FALSE for non-terminal stdin, so command line is printed anyway. */
	/* (DFK 11/89) */
	screen_ok = interactive; 

	do_line();
}


do_line()	  /* also used in load_file */
{
	if (is_system(input_line[0])) {
		do_system();
		(void) fputs("!\n",stderr);
		return;
	}
	num_tokens = scanner(input_line);
	c_token = 0;
	while(c_token < num_tokens) {
		command();
		if (c_token < num_tokens)	/* something after command */
			if (equals(c_token,";"))
				c_token++;
			else
					int_error("';' expected",c_token);
	}
}



command()
{
    int i;
    char sv_file[MAX_LINE_LEN+1];
    /* string holding name of save or load file */

	for (i = 0; i < MAX_NUM_VAR; i++)
	    c_dummy_var[i][0] = '\0';		/* no dummy variables */

	if (is_definition(c_token))
		define();
	else if (almost_equals(c_token,"h$elp") || equals(c_token,"?")) {
	    c_token++;
	    do_help();
	}
	else if (almost_equals(c_token,"test")) {
	    c_token++;
		test_term();
	}
	else if (almost_equals(c_token,"pa$use")) {
		struct value a;
		int stime, text=0;
		char buf[MAX_LINE_LEN+1];

		c_token++;
		stime = (int )real(const_express(&a));
		if (!(END_OF_COMMAND)) {
			if (!isstring(c_token))
				int_error("expecting string",c_token);
			else {
				quotel_str(buf,c_token);
				(void) fprintf (stderr, "%s",buf);
				text = 1;
			}
		}
		if (stime < 0) (void) fgets (buf,MAX_LINE_LEN,stdin);  
						/* Hold until CR hit. */
#ifdef __ZTC__
		if (stime > 0) usleep((unsigned long) stime);
#else
		if (stime > 0) sleep((unsigned int) stime);
#endif
		if (text != 0 && stime >= 0) (void) fprintf (stderr,"\n");
		c_token++;
		screen_ok = FALSE;
	}
	else if (almost_equals(c_token,"pr$int")) {
		struct value a;

		c_token++;
		(void) const_express(&a);
		(void) putc('\t',stderr);
		disp_value(stderr,&a);
		(void) putc('\n',stderr);
		screen_ok = FALSE;
	}
	else if (almost_equals(c_token,"p$lot")) {
		plot_token = c_token++;
		plotrequest();
	}
	else if (almost_equals(c_token,"sp$lot")) {
		plot_token = c_token++;
		plot3drequest();
	}
	else if (almost_equals(c_token,"rep$lot")) {
		if (replot_line[0] == '\0') 
			int_error("no previous plot",c_token);
		c_token++;
		replotrequest();
	}
	else if (almost_equals(c_token,"se$t"))
		set_command();
	else if (almost_equals(c_token,"sh$ow"))
		show_command();
	else if (almost_equals(c_token,"cl$ear")) {
		if (!term_init) {
			(*term_tbl[term].init)();
			term_init = TRUE;
		}
		(*term_tbl[term].graphics)();
		(*term_tbl[term].text)();
		(void) fflush(outfile);
		screen_ok = FALSE;
		c_token++;
	}
	else if (almost_equals(c_token,"she$ll")) {
		do_shell();
		screen_ok = FALSE;
		c_token++;
	}
	else if (almost_equals(c_token,"sa$ve")) {
		if (almost_equals(++c_token,"f$unctions")) {
			if (!isstring(++c_token))
				int_error("expecting filename",c_token);
			else {
				quote_str(sv_file,c_token);
				save_functions(fopen(sv_file,"w"));
			}
		}
		else if (almost_equals(c_token,"v$ariables")) {
			if (!isstring(++c_token))
				int_error("expecting filename",c_token);
			else {
				quote_str(sv_file,c_token);
				save_variables(fopen(sv_file,"w"));
			}
		}
		else if (almost_equals(c_token,"s$et")) {
			if (!isstring(++c_token))
				int_error("expecting filename",c_token);
			else {
				quote_str(sv_file,c_token);
				save_set(fopen(sv_file,"w"));
			}
		}
		else if (isstring(c_token)) {
			quote_str(sv_file,c_token);
			save_all(fopen(sv_file,"w"));
		}
		else {
			int_error(
		"filename or keyword 'functions', 'variables', or 'set' expected",
					c_token);
		}
		c_token++;
	}
	else if (almost_equals(c_token,"l$oad")) {
		if (!isstring(++c_token))
			int_error("expecting filename",c_token);
		else {
			quote_str(sv_file,c_token);
			load_file(fopen(sv_file,"r"), sv_file);	
		/* input_line[] and token[] now destroyed! */
			c_token = num_tokens = 0;
		}
	}
	else if (almost_equals(c_token,"cd")) {
		if (!isstring(++c_token))
			int_error("expecting directory name",c_token);
		else {
			quotel_str(sv_file,c_token);
			if (chdir(sv_file)) {
			  int_error("Can't change to this directory",c_token);
			}
		c_token++;
		}
	}
	else if (almost_equals(c_token,"pwd")) {
#if defined(unix) && !defined(hpux)
#ifdef GETCWD
	  (void) getcwd(sv_file,MAX_ID_LEN); /* some Unix's use getcwd */
#else
	  (void) getwd(sv_file); /* most Unix's use getwd */
#endif
#else
/* Turbo C and VMS have getcwd() */
	  (void) getcwd(sv_file,MAX_ID_LEN);
#endif
	  fprintf(stderr,"%s\n", sv_file);
	  c_token++;
	}
	else if (almost_equals(c_token,"ex$it") ||
			almost_equals(c_token,"q$uit")) {
		done(IO_SUCCESS);
	}
	else if (!equals(c_token,";")) {		/* null statement */
		int_error("invalid command",c_token);
	}
}

replotrequest()
{
char str[MAX_LINE_LEN+1];
		if(equals(c_token,"["))
			int_error("cannot set range with replot",c_token);
		if (!END_OF_COMMAND) {
			capture(str,c_token,num_tokens-1);
			if ( (strlen(str) + strlen(replot_line)) <= MAX_LINE_LEN-1) {
				(void) strcat(replot_line,",");
				(void) strcat(replot_line,str); 
			} else {
				int_error("plot line too long with replot arguments",c_token);
			}
		}
		(void) strcpy(input_line,replot_line);
		screen_ok = FALSE;
		num_tokens = scanner(input_line);
		c_token = 1;					/* skip the 'plot' part */
		is_3d_plot ? plot3drequest() : plotrequest();
}


plotrequest()
/*
   In the parametric case we can say 
      plot [a= -4:4] [-2:2] [-1:1] sin(a),a**2
   while in the non-parametric case we would say only
      plot [b= -2:2] [-1:1] sin(b)
*/
{
    BOOLEAN changed;
    int dummy_token = -1;

    is_3d_plot = FALSE;

    if (parametric && strcmp(dummy_var[0], "u") == 0)
	strcpy (dummy_var[0], "t");

    autoscale_lt = autoscale_t;
    autoscale_lx = autoscale_x;
    autoscale_ly = autoscale_y;

	if (!term)					/* unknown */
		int_error("use 'set term' to set terminal type first",c_token);

	if (equals(c_token,"[")) {
		c_token++;
		if (isletter(c_token)) {
		    if (equals(c_token+1,"=")) {
			   dummy_token = c_token;
			   c_token += 2;
		    } else {
			   /* oops; probably an expression with a variable. */
			   /* Parse it as an xmin expression. */
			   /* used to be: int_error("'=' expected",c_token); */
		    }
		}
		changed = parametric ? load_range(&tmin,&tmax):load_range(&xmin,&xmax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed) {
			if (parametric)
				autoscale_lt = FALSE;
			else
				autoscale_lx = FALSE;
		}
	}

	if (parametric && equals(c_token,"[")) { /* set optional x ranges */
		c_token++;
		changed = load_range(&xmin,&xmax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed)
		  autoscale_lx = FALSE;
	}

	if (equals(c_token,"[")) { /* set optional y ranges */
		c_token++;
		changed = load_range(&ymin,&ymax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed)
		  autoscale_ly = FALSE;
	}

     /* use the default dummy variable unless changed */
	if (dummy_token >= 0)
	  copy_str(c_dummy_var[0],dummy_token);
	else
	  (void) strcpy(c_dummy_var[0],dummy_var[0]);

	eval_plots();
}

plot3drequest()
/*
   in the parametric case we would say
      splot [u= -Pi:Pi] [v= 0:2*Pi] [-1:1] [-1:1] [-1:1] sin(v)*cos(u),sin(v)*cos(u),sin(u)
   in the non-parametric case we would say only
      splot [x= -2:2] [y= -5:5] sin(x)*cos(y)

*/
{
    BOOLEAN changed;
    int dummy_token0 = -1,
	dummy_token1 = -1;

    is_3d_plot = TRUE;

    if (parametric && strcmp(dummy_var[0], "t") == 0) {
    	strcpy (dummy_var[0], "u");
    	strcpy (dummy_var[1], "v");
    }

    autoscale_lx = autoscale_x;
    autoscale_ly = autoscale_y;
    autoscale_lz = autoscale_z;

	if (!term)					/* unknown */
		int_error("use 'set term' to set terminal type first",c_token);

	if (equals(c_token,"[")) {
		c_token++;
		if (isletter(c_token)) {
		    if (equals(c_token+1,"=")) {
			   dummy_token0 = c_token;
			   c_token += 2;
		    } else {
			   /* oops; probably an expression with a variable. */
			   /* Parse it as an xmin expression. */
			   /* used to be: int_error("'=' expected",c_token); */
		    }
		}
		changed = parametric ? load_range(&umin,&umax):load_range(&xmin,&xmax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed && !parametric) {
			autoscale_lx = FALSE;
		}
	}

	if (equals(c_token,"[")) {
		c_token++;
		if (isletter(c_token)) {
		    if (equals(c_token+1,"=")) {
			   dummy_token1 = c_token;
			   c_token += 2;
		    } else {
			   /* oops; probably an expression with a variable. */
			   /* Parse it as an xmin expression. */
			   /* used to be: int_error("'=' expected",c_token); */
		    }
		}
		changed = parametric ? load_range(&vmin,&vmax):load_range(&ymin,&ymax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed && !parametric) {
			autoscale_ly = FALSE;
		}
	}

	if (equals(c_token,"[")) { /* set optional x ranges */
		c_token++;
		changed = load_range(&xmin,&xmax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed)
		  autoscale_lx = FALSE;
	}

	if (equals(c_token,"[")) { /* set optional y ranges */
		c_token++;
		changed = load_range(&ymin,&ymax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed)
		  autoscale_ly = FALSE;
	}

	if (equals(c_token,"[")) { /* set optional z ranges */
		c_token++;
		changed = load_range(&zmin,&zmax);
		if (!equals(c_token,"]"))
			int_error("']' expected",c_token);
		c_token++;
		if (changed)
		  autoscale_lz = FALSE;
	}

     /* use the default dummy variable unless changed */
	if (dummy_token0 >= 0)
	  copy_str(c_dummy_var[0],dummy_token0);
	else
	  (void) strcpy(c_dummy_var[0],dummy_var[0]);

	if (dummy_token1 >= 0)
	  copy_str(c_dummy_var[1],dummy_token1);
	else
	  (void) strcpy(c_dummy_var[1],dummy_var[1]);

	eval_3dplots();
}


define()
{
register int start_token;  /* the 1st token in the function definition */
register struct udvt_entry *udv;
register struct udft_entry *udf;

	if (equals(c_token+1,"(")) {
		/* function ! */
		start_token = c_token;
		copy_str(c_dummy_var[0], c_token + 2);
		if(equals(c_token+3,",")) {
			copy_str(c_dummy_var[1], c_token + 4);
			c_token += 2;  /* skip the  , dummy2 */
		}
		c_token += 5; /* skip (, dummy, ) and = */
		if (END_OF_COMMAND)
			int_error("function definition expected",c_token);
		udf = dummy_func = add_udf(start_token);
		if (udf->at)				/* already a dynamic a.t. there */
			free((char *)udf->at);	/* so free it first */
		if ((udf->at = perm_at()) == (struct at_type *)NULL)
			int_error("not enough memory for function",start_token);
		m_capture(&(udf->definition),start_token,c_token-1);
	}
	else {
		/* variable ! */
		start_token = c_token;
		c_token +=2;
		udv = add_udv(start_token);
		(void) const_express(&(udv->udv_value));
		udv->udv_undef = FALSE;
	}
}


get_data(this_plot)
struct curve_points *this_plot;
{
register int i, l_num, datum;
register FILE *fp;
float x, y;
float ylow, yhigh;			/* for error bars */
float temp;
BOOLEAN yfirst;
char format[MAX_LINE_LEN+1], data_file[MAX_LINE_LEN+1], line[MAX_LINE_LEN+1];
char *float_format = "%f", *float_skip = "%*f";
int xcol = 1, ycol = 2, yemin = 3, yemax = 4;
struct value colvalue;
#ifdef AMIGA_LC_5_1
int num_perc_ast;
char *start_search;
#endif /* AMIGA_LC_5_1 */

	quote_str(data_file, c_token);
	this_plot->plot_type = DATA;
	if( parametric)
		int_error("Parametric data files not yet implemented",NO_CARET);
#ifdef unix
	if ( *data_file == '<' ) {
	  	if ((fp = popen(data_file+1,"r")) == (FILE *)NULL)
	    	os_error("cannot create pipe; output not changed",c_token);
		else
		    pipe_open = TRUE;
	} else
#endif
	if ((fp = fopen(data_file, "r")) == (FILE *)NULL)
		os_error("can't open data file", c_token);

	format[0] = '\0';
	yfirst = FALSE;
	c_token++;	/* skip data file name */
	if (almost_equals(c_token,"u$sing")) {
		c_token++;  	/* skip "using" */
		if (!END_OF_COMMAND && !isstring(c_token)) {
			struct value a;
			ycol = (int)magnitude(const_express(&a));
			xcol = ycol;
			if (equals(c_token,":")) {
				c_token++;      /* skip ":" */
				ycol = (int)magnitude(const_express(&a));
				if (equals(c_token,":")) {
					c_token++;      /* skip ":" */
					yemin = (int)magnitude(const_express(&a));
					if (equals(c_token,":")) {
						c_token++;      /* skip ":" */
						yemax = (int)magnitude(const_express(&a));
					}
					else
					        yemax = -1;
				}
				else {
				        yemin = -1;
				        yemax = -1;
				}
			}
			else {
			        yemin = -1;
			        yemax = -1;
			}
			if (xcol > ycol) yfirst = TRUE;
		}
		if (!END_OF_COMMAND && isstring(c_token)) {
			quotel_str(format, c_token);
			c_token++;	/* skip format */
		}
	}
	if (strlen(format) == 0) {
		for(i = 1; i <= ((xcol > ycol) ? xcol : ycol); i++)
			if ((i == xcol) || (i == ycol))
				(void) strcat(format,float_format);
			else
				(void) strcat(format,float_skip);

		if (yemin > 0) {
			/* We have error bars - handle them. */
			yemin -= (xcol > ycol) ? xcol : ycol;
			yemax -= (xcol > ycol) ? xcol : ycol;
			if (yemin > yemax && yemax > 0) {
				i = yemin;
				yemin = yemax;
				yemax = i;
			}

			if (yemin == yemax)
				int_error("Two error bar columns are the same",
					  NO_CARET);

			if (yemin <= 0)
				int_error("Error bar columns must follow data columns",
					  NO_CARET);

			for (i = 1; i < yemin; i++)
				(void) strcat(format,float_skip);
			(void) strcat(format,float_format);

			if (yemax > 0) {
				for (i = 1; i < yemax - yemin; i++)
					(void) strcat(format,float_skip);
				(void) strcat(format,float_format);
			}
		}
	}

	l_num = 0;
     datum = 0;
	i = 0;
#ifdef AMIGA_LC_5_1
	num_perc_ast = 0;
	start_search = format;
	while (*start_search != '\0') {
		if (start_search[0] == '%')
			if (start_search[1] == '*') num_perc_ast++;
		start_search++;
	}
#endif /* AMIGA_LC_5_1 */
	while ( fgets(line, MAX_LINE_LEN, fp) != (char *)NULL ) {
		l_num++;
		if (is_comment(line[0]))
			continue;		/* ignore comments */
		if (i >= this_plot->p_max) {
		    /* overflow about to occur. Extend size of points[]
			* array. We either double the size, or add 1000 points,
			* whichever is a smaller increment. Note i=p_max.
			*/
		    cp_extend(this_plot, i + (i < 1000 ? i : 1000));
		}
		if (!line[1]) { /* is it blank line ? */
			/* break in data, make next point undefined */
			this_plot->points[i].type = UNDEFINED;
			i++;
			continue;
		}

#ifdef AMIGA_LC_5_1
		switch (sscanf(line, format, &x, &y, &ylow, &yhigh) -
			 num_perc_ast) {
#else /* AMIGA_LC_5_1 */
		switch (sscanf(line, format, &x, &y, &ylow, &yhigh)) {
#endif /* AMIGA_LC_5_1 */
		    case 1: {		/* only one number on the line */
			   y = x;		/* assign that number to y */
			   x = datum;	/* and make the index into x */
			   /* no break; !!! */
		    }
		    case 2: {
			   if (yfirst) { /* exchange x and y */
				  temp = y;
				  y = x;
				  x = temp;
			   }
			   datum++;

			   /* ylow and yhigh are same as y */
			   store2d_point(this_plot, i++, x, y, y, y);
			   break;
		    }
		    case 3: {		/* x, y, ydelta */
			   if (yfirst) { /* exchange x and y */
				  temp = y;
				  y = x;
				  x = temp;
			   }
			   datum++;

			   /* ydelta is in the ylow variable */
			   store2d_point(this_plot, i++, x, y, y-ylow, y+ylow);
			   break;
		    }
		    case 4: {		/* x, y, ylow, yhigh */
			   if (yfirst) { /* exchange x and y */
				  temp = y;
				  y = x;
				  x = temp;
			   }
			   datum++;

			   store2d_point(this_plot, i++, x, y, ylow, yhigh);
			   break;
		    }
		    default: {
			   (void) sprintf(line, "bad data on line %d", l_num);
			   int_error(line,c_token);
		    }
		}
	}
	this_plot->p_count = i;
	cp_extend(this_plot, i);	/* shrink to fit */

#ifdef unix
	if ( pipe_open ) {
		(void) pclose(fp);
		pipe_open = FALSE;
	} else
#endif
	(void) fclose(fp);
}

/* called by get_data for each point */
store2d_point(this_plot, i, x, y, ylow, yhigh)
struct curve_points *this_plot;
int i;					/* point number */
#ifdef AMIGA_LC_5_1
double x, y;
double ylow, yhigh;
#else
float x, y;
float ylow, yhigh;
#endif
{
    struct coordinate *cp = &(this_plot->points[i]);

    /* the easy part: */
    cp->type = INRANGE;
    cp->x = x;
    cp->y = y;
    cp->ylow = ylow;
    cp->yhigh = yhigh;
    
    /* Adjust for log scale. */
    if (log_x)
	 cp->type = adjustlog(cp->type, &(cp->x));
    if (log_y) {
	   cp->type = adjustlog(cp->type, &(cp->y));
	   /* Note ylow,yhigh can't affect cp->type. */
	   (void)     adjustlog(cp->type, &(cp->ylow));
	   (void)     adjustlog(cp->type, &(cp->yhigh));
    }

    /* Now adjust the xrange, or declare the point out of range */
    /* The yrange is handled later, once we know whether to 
	* include ylow, yhigh in the calculation. See adjust_yrange()
	*/
    if (cp->type == INRANGE)
	 if (autoscale_lx || inrange(x,xmin,xmax)) {
		if (autoscale_lx) {
		    if (x < xmin) xmin = x;
		    if (x > xmax) xmax = x;
		}
	 } else {
		cp->type = OUTRANGE;
	 }
}

/* Adjust for log scale:
 * take the log of the second parameter, in place, if possible. 
 * If not possible, return new type for point; if possible, then 
 * return old type for point.
 */
static enum coord_type
adjustlog(type, val)
	enum coord_type type;
	coordval *val;
{
    if (*val < 0.0) {
	   return(UNDEFINED);
    } else if (*val == 0.0) {
	   *val = -VERYLARGE;
	   return(OUTRANGE);
    } else {
	   *val = log10(*val);
	   return(type);
    }
}


/* now adjust the yrange, or declare the point out of range */
/* this does all points in a curve */
adjust_yrange(curve)
	struct curve_points *curve;
{
    BOOLEAN ebars = (curve->plot_style == ERRORBARS);
    int npoints = curve->p_count; /* number of points */
    coordval y, ylow, yhigh;	/* one point value */
    struct coordinate *cp;	/* one coordinate */
    int i;				/* index into points */

    for (i = 0; i < npoints; i++) {
	   cp = &(curve->points[i]);
	   if (cp->type == INRANGE) {
		  y = log_y ? pow(10.0,cp->y) : cp->y;
		  if ((autoscale_ly ||
		       inrange(y, ymin, ymax) ||
		       polar)) {
			 if (autoscale_ly) {
				if (y < ymin) ymin = y;
				if (y > ymax) ymax = y;
				if (ebars) {
				    ylow =  log_y ? pow(10.0,cp->ylow)  : cp->ylow;
				    yhigh = log_y ? pow(10.0,cp->yhigh) : cp->yhigh;
				    if (ylow < ymin) ymin = ylow;
				    if (ylow > ymax) ymax = ylow;
				    if (yhigh < ymin) ymin = yhigh;
				    if (yhigh > ymax) ymax = yhigh;
				}
			 }
		  } else {
			 cp->type = OUTRANGE;
		  }
	   }
    }
}


get_3ddata(this_plot)
struct surface_points *this_plot;
{
register int i, j, l_num, xdatum, ydatum;
register FILE *fp;
float x, y, z;
BOOLEAN only_z = FALSE;
char format[MAX_LINE_LEN+1], data_file[MAX_LINE_LEN+1], line[MAX_LINE_LEN+1];
char *float_format = "%f", *float_skip = "%*f";
int xcol = 1, ycol = 2, zcol = 3, pt_in_iso_crv = 0, maxcol;
enum XYZ_order_type {XYZ, YXZ, ZXY, XZY, ZYX, YZX, XY, YX} xyz_order;
struct iso_curve *this_iso;
#ifdef AMIGA_LC_5_1
int num_perc_ast;
char *start_search;
#endif /* AMIGA_LC_5_1 */
	    
	quote_str(data_file, c_token);
	this_plot->plot_type = DATA3D;
	this_plot->has_grid_topology = TRUE;
#ifdef unix
	if ( *data_file == '<' ) {
		if ((fp = popen(data_file+1,"r")) == (FILE *)NULL)
		    os_error("cannot create pipe; output not changed",c_token);
	  	else
		    pipe_open = TRUE;
	} else
#endif
	if ((fp = fopen(data_file, "r")) == (FILE *)NULL)
		os_error("can't open data file", c_token);

	format[0] = '\0';
	c_token++;	/* skip data file name */
	if (almost_equals(c_token,"u$sing")) {
		c_token++;  	/* skip "using" */
		if (!END_OF_COMMAND && !isstring(c_token)) {
			struct value a;
			zcol = (int)magnitude(const_express(&a));
			only_z = TRUE;
			if (equals(c_token,":")) {
				c_token++;	/* skip ":" */
				only_z = FALSE;
				ycol = zcol;
				zcol = (int)magnitude(const_express(&a));
				if (equals(c_token,":")) {
					c_token++;	/* skip ":" */
					xcol = ycol;
					ycol = zcol;
					zcol = (int)magnitude(const_express(&a));
				}
				else {
					if (mapping3d == MAP3D_CARTESIAN)
						int_error("Must specify 1 or 3 columns",c_token);
					xcol = ycol;
					ycol = zcol;
				}
			}
			if (!only_z)
				if ( (xcol == ycol) || (ycol == zcol) || (xcol == zcol))
					int_error("Columns must be distinct",c_token);
		}
		if (!END_OF_COMMAND && isstring(c_token)) {
			quotel_str(format, c_token);
			c_token++;	/* skip format */
		}
	}
	else {
	    if ( only_z = !parametric )
		zcol = 1;
	}

	switch (mapping3d) {
	    case MAP3D_CARTESIAN:
		maxcol = (xcol > ycol) ? xcol : ycol;
		maxcol = (maxcol > zcol) ? maxcol : zcol;
		if (!only_z) {	/* Determine ordering of input columns */
 			if (zcol == maxcol) {
 				if (xcol < ycol)
 					xyz_order = XYZ;  /* scanf(x,y,z) */
 				else
 					xyz_order = YXZ;  /* scanf(y,x,z) */
 			}
 			else if (ycol == maxcol) {
 				if (xcol < zcol)
 					xyz_order = XZY;  /* scanf(x,z,y) */
 				else
 					xyz_order = ZXY;  /* scanf(z,x,y) */
 			}
 			else {
 				if (ycol < zcol)
 					xyz_order = YZX;  /* scanf(y,z,x) */
 				else
 					xyz_order = ZYX;  /* scanf(z,y,x) */
 			}
		}
		if (strlen(format) == 0) {
			if (only_z) {
				for(i = 1; i <= zcol; i++)
					if (i == zcol)
						(void) strcat(format,float_format);
					else
						(void) strcat(format,float_skip);
			}
			else {
				for(i = 1; i <= maxcol; i++)
					if ((i == xcol) || (i == ycol) || (i == zcol))
						(void) strcat(format,float_format);
					else
						(void) strcat(format,float_skip);
			}
		}
	        break;
	    case MAP3D_SPHERICAL:
	    case MAP3D_CYLINDRICAL:
		if (only_z)
			int_error("Two columns for spherical/cylindrical coords.",c_token);
		maxcol = (xcol > ycol) ? xcol : ycol;
		xyz_order = (xcol < ycol) ? XY : YX;
		for(i = 1; i <= maxcol; i++)
			if ((i == xcol) || (i == ycol))
				(void) strcat(format,float_format);
			else
				(void) strcat(format,float_skip);
	}
#ifdef AMIGA_LC_5_1
	num_perc_ast = 0;
	start_search = format;
	while (*start_search != '\0') {
		if (start_search[0] == '%')
			if (start_search[1] == '*') num_perc_ast++;
		start_search++;
	}
#endif /* AMIGA_LC_5_1 */

	l_num = 0;
	xdatum = 0;
	ydatum = 0;
	this_plot->num_iso_read = 0;
	this_plot->has_grid_topology = TRUE;
	if ( this_plot->iso_crvs != NULL ) {
	    struct iso_curve *icrv, *icrvs = this_plot->iso_crvs;

	    while ( icrvs ) {
		icrv = icrvs;
		icrvs = icrvs->next;
		iso_free( icrv );
	    }
	    this_plot->iso_crvs = NULL;
	}
	this_iso = iso_alloc( samples );

	while ( fgets(line, MAX_LINE_LEN, fp) != (char *)NULL ) {
		l_num++;
		if (is_comment(line[0]))
			continue;		/* ignore comments */
		if (!line[1]) {			/* is it blank line ? */
		        if (pt_in_iso_crv == 0) {
			        if (xdatum == 0)
					continue;
			        pt_in_iso_crv = xdatum;
			}

			if (xdatum > 0) {
				this_iso->p_count = xdatum;
				this_iso->next = this_plot->iso_crvs;
				this_plot->iso_crvs = this_iso;
				this_plot->num_iso_read++;

				if (xdatum != pt_in_iso_crv)
					this_plot->has_grid_topology = FALSE;

				this_iso = iso_alloc(pt_in_iso_crv);
				xdatum = 0;
				ydatum++;
			}
			continue;
		}

		if (xdatum >= this_iso->p_max)
		{
		    /* overflow about to occur. Extend size of points[]
			* array. We either double the size, or add 1000 points,
			* whichever is a smaller increment. Note i=p_max.
			*/
		    iso_extend(this_iso,
			       xdatum + (xdatum < 1000 ? xdatum : 1000));
		}

#ifdef AMIGA_LC_5_1
		switch (sscanf(line, format, &x, &y, &z) - num_perc_ast) {
#else
		switch (sscanf(line, format, &x, &y, &z)) {
#endif
		    case 3: 		/* All parameter are specified. */
			   if (!only_z) {
				switch (xyz_order) {
				   case XYZ:	/* scanf(x,y,z) */
					this_iso->points[xdatum].x = x;
					this_iso->points[xdatum].y = y;
					this_iso->points[xdatum].z = z;
					break;
				   case XZY:	/* scanf(x,z,y) */
					this_iso->points[xdatum].x = x;
					this_iso->points[xdatum].y = z;
					this_iso->points[xdatum].z = y;
					break;
				   case YXZ: 	/* scanf(y,x,z) */
					this_iso->points[xdatum].x = y;
					this_iso->points[xdatum].y = x;
					this_iso->points[xdatum].z = z;
					break;
				   case ZXY:	/* scanf(z,x,y) */
					this_iso->points[xdatum].x = y;
					this_iso->points[xdatum].y = z;
					this_iso->points[xdatum].z = x;
					break;
				   case YZX:	/* scanf(y,z,x) */
					this_iso->points[xdatum].x = z;
					this_iso->points[xdatum].y = x;
					this_iso->points[xdatum].z = y;
					break;
				   case ZYX:	/* scanf(z,y,x) */
					this_iso->points[xdatum].x = z;
					this_iso->points[xdatum].y = y;
					this_iso->points[xdatum].z = x;
					break;
				}
				if (xyz_order != XYZ) {
					x = this_iso->points[xdatum].x;
					y = this_iso->points[xdatum].y;
					z = this_iso->points[xdatum].z;
				}
				if (!parametric)
					int_error("Must be in parametric mode.",
						  NO_CARET);
			   	break;
			   }
		    case 1: 		/* only one number on the line */
			   if (!only_z)
				int_error("3 columns expected, only 1 found", c_token);
			   /* assign that number to z */
			   this_iso->points[xdatum].z = x;
			   z = x;
			   this_iso->points[xdatum].x = xdatum;
			   x = this_iso->points[xdatum].x;
			   this_iso->points[xdatum].y = ydatum;
			   y = this_iso->points[xdatum].y;
			   if (parametric)
				int_error("Must be in non parametric mode.",
					  NO_CARET);
			   break;
		    case 2:
			   switch (xyz_order) {
			       case YX:
				   z = x;	/* Use z as temp */
				   x = y;
				   y = z;
				   break;
			       default:
				   break;
			   }
			   switch (mapping3d) {
			       case MAP3D_CARTESIAN:
			           int_error("2 columns found, 3 expected",
					     c_token);
				   break;
			       case MAP3D_SPHERICAL:
				   if (angles_format == ANGLES_DEGREES) {
				       x *= DEG2RAD; /* Convert to radians. */
				       y *= DEG2RAD;
				   }
				   this_iso->points[xdatum].x = cos(x) * cos(y);
				   this_iso->points[xdatum].y = sin(x) * cos(y);
				   this_iso->points[xdatum].z = sin(y);
				   break;
			       case MAP3D_CYLINDRICAL:
				   if (angles_format == ANGLES_DEGREES)
				       x *= DEG2RAD; /* Convert to radians. */
				   this_iso->points[xdatum].x = cos(x);
				   this_iso->points[xdatum].y = sin(x);
				   this_iso->points[xdatum].z = y;
				   break;
			   }
			   x = this_iso->points[xdatum].x;
			   y = this_iso->points[xdatum].y;
			   z = this_iso->points[xdatum].z;
			   break;
		    default:
			   (void) sprintf(line, "bad data on line %d", l_num);
			   int_error(line,c_token);
		}

		if (log_x) {
		    if (x < 0.0)
			int_error("X value must be above 0 for log scale!",
				  NO_CARET);
		    else
			this_iso->points[xdatum].x =
			    log10(this_iso->points[xdatum].x);
		}
		if (log_y) {
		    if (y < 0.0)
			int_error("Y value must be above 0 for log scale!",
				  NO_CARET);
		    else
			this_iso->points[xdatum].y =
			    log10(this_iso->points[xdatum].y);
		}
		if (log_z) {
		    if (z < 0.0)
			int_error("Z value must be above 0 for log scale!",
				  NO_CARET);
		    else
			this_iso->points[xdatum].z =
			    log10(this_iso->points[xdatum].z);
		}

		if (autoscale_lx) {
			if (x < xmin) xmin = x;
			if (x > xmax) xmax = x;
		}
		if (autoscale_ly) {
			if (y < ymin) ymin = y;
			if (y > ymax) ymax = y;
		}
		if (autoscale_lz) {
			if (z < zmin) zmin = z;
			if (z > zmax) zmax = z;
		}

		xdatum++;
	}

	if (xdatum > 0) {
		this_plot->num_iso_read++; /* Update last iso. */
		this_iso->p_count = xdatum;

		this_iso->next = this_plot->iso_crvs; 
		this_plot->iso_crvs = this_iso;

		if (xdatum != pt_in_iso_crv)
			this_plot->has_grid_topology = FALSE;

	}
	else {
		iso_free(this_iso);/* Free last allocation. */
	}

#ifdef unix
	if ( pipe_open ) {
		(void) pclose(fp);
		pipe_open = FALSE;
	} else
#endif
	(void) fclose(fp);
      if (this_plot->num_iso_read <= 1)
          this_plot->has_grid_topology = FALSE;
	if (this_plot->has_grid_topology) {
	        struct iso_curve *new_icrvs = NULL;
		int num_new_iso = this_plot->iso_crvs->p_count,
		    len_new_iso = this_plot->num_iso_read;

		/* Now we need to set the other direction (pseudo) isolines. */
	        for (i = 0; i < num_new_iso; i++) {
		    struct iso_curve *new_icrv = iso_alloc(len_new_iso);

		    new_icrv->p_count = len_new_iso;

		    for (j = 0, this_iso = this_plot->iso_crvs;
		         this_iso != NULL;
			 j++, this_iso = this_iso->next) {
			new_icrv->points[j].x = this_iso->points[i].x;
		     	new_icrv->points[j].y = this_iso->points[i].y;
		     	new_icrv->points[j].z = this_iso->points[i].z;
		    }

		    new_icrv->next = new_icrvs;
		    new_icrvs = new_icrv;
		}

		/* Append the new iso curves after the read ones. */
		for (this_iso = this_plot->iso_crvs;
		     this_iso->next != NULL;
		     this_iso = this_iso->next);
		this_iso->next = new_icrvs;
	}
}

/* print_points:
 * a debugging routine to print out the points of a curve,
 * and the curve structure. If curve<0, then we print the 
 * list of curves.
 */
static char *plot_type_names[4] = {
    "Function", "Data", "3D Function", "3d data"
};
static char *plot_style_names[6] = {
    "Lines", "Points", "Impulses", "LinesPoints", "Dots", "Errorbars"
};

print_points(curve)
	int curve;			/* which curve to print */
{
    register struct curve_points *this_plot;
    int i;

    if (curve < 0) {
	   for (this_plot = first_plot, i=0; 
		   this_plot != NULL; 
		   i++, this_plot = this_plot->next_cp) {
		  printf("Curve %d:\n", i);
		  if ((int)this_plot->plot_type >= 0 && (int)(this_plot->plot_type) < 4)
		    printf("Plot type %d: %s\n", (int)(this_plot->plot_type),
				 plot_type_names[(int)(this_plot->plot_type)]);
		  else
		    printf("Plot type %d: BAD\n", (int)(this_plot->plot_type));
		  if ((int)this_plot->plot_style >= 0 && (int)(this_plot->plot_style) < 6)
		    printf("Plot style %d: %s\n", (int)(this_plot->plot_style),
				 plot_style_names[(int)(this_plot->plot_style)]);
		  else
		    printf("Plot style %d: BAD\n", (int)(this_plot->plot_style));
		  printf("Plot title: '%s'\n", this_plot->title);
		  printf("Line type %d\n", this_plot->line_type);
		  printf("Point type %d\n", this_plot->point_type);
		  printf("max points %d\n", this_plot->p_max);
		  printf("current points %d\n", this_plot->p_count);
		  printf("\n");
	   }
    } else {
	   for (this_plot = first_plot, i = 0; 
		   i < curve && this_plot != NULL; 
		   i++, this_plot = this_plot->next_cp)
		;
	   if (this_plot == NULL)
		printf("Curve %d does not exist; list has %d curves\n", curve, i);
	   else {
		  printf ("Curve %d, %d points\n", curve, this_plot->p_count);
		  for (i = 0; i < this_plot->p_count; i++) {
			 printf("%c x=%g y=%g z=%g ylow=%g yhigh=%g\n", 
				   this_plot->points[i].type == INRANGE ? 'i'
				   : this_plot->points[i].type == OUTRANGE ? 'o'
				   : 'u',
				   this_plot->points[i].x,
				   this_plot->points[i].y,
				   this_plot->points[i].z,
				   this_plot->points[i].ylow,
				   this_plot->points[i].yhigh);
		  }
		  printf("\n");
	   }
    }    
}

print_table()
{
    register struct curve_points *this_plot;
    int i, curve;

   for (this_plot = first_plot, curve = 0; this_plot != NULL;
       curve++, this_plot = this_plot->next_cp)
   {
	  fprintf(outfile,"Curve %d, %d points\n", curve, this_plot->p_count);
	  for (i = 0; i < this_plot->p_count; i++) {
		 fprintf(outfile,"%c x=%g y=%g\n",
			   this_plot->points[i].type == INRANGE ? 'i'
			   : this_plot->points[i].type == OUTRANGE ? 'o'
			   : 'u',
			   this_plot->points[i].x,
			   this_plot->points[i].y);
	  }
	  fprintf(outfile,"\n");
   }
   fflush(outfile);
}

print_3dtable()
{
    register struct surface_points *this_3dplot;
    int i, curve;
    struct gnuplot_contours *contours;      /* Not NULL If have contours. */
    struct iso_curve *isocrv;

    for (this_3dplot = first_3dplot, curve = 0; this_3dplot != NULL;
       curve++, this_3dplot = this_3dplot->next_sp)
    {
	  isocrv = this_3dplot->iso_crvs;
	  fprintf(outfile,"Curve %d, %d points\n", curve, isocrv->p_count);
	  for (i = 0; i < isocrv->p_count; i++) {
		 fprintf(outfile,"%c x=%g y=%g z=%g\n",
			   isocrv->points[i].type == INRANGE ? 'i'
			   : isocrv->points[i].type == OUTRANGE ? 'o'
			   : 'u',
			   isocrv->points[i].x,
			   isocrv->points[i].y,
			   isocrv->points[i].z);
	  }
	  fprintf(outfile,"\n");
   }
   fflush(outfile);
}

/* This parses the plot command after any range specifications. 
 * To support autoscaling on the x axis, we want any data files to 
 * define the x range, then to plot any functions using that range. 
 * We thus parse the input twice, once to pick up the data files, 
 * and again to pick up the functions. Definitions are processed 
 * twice, but that won't hurt.
 */
eval_plots()
{
register int i;
register struct curve_points *this_plot, **tp_ptr;
register int start_token, end_token;
register int begin_token;
double x_min, x_max, y_min, y_max;
register double x, xdiff, temp;
static struct value a;
BOOLEAN ltmp, some_data_files = FALSE;
int plot_num, line_num, point_num, xparam=0;
char *xtitle;
void parametric_fixup();

	if (autoscale_ly) {
		ymin = VERYLARGE;
		ymax = -VERYLARGE;
	} else if (log_y && (ymin <= 0.0 || ymax <= 0.0))
			int_error("y range must be above 0 for log scale!",
				NO_CARET);

	tp_ptr = &(first_plot);
	plot_num = 0;
	line_num = 0; 	/* default line type */
	point_num = 0;	/* default point type */

	xtitle = NULL;

	begin_token = c_token;

/*** First Pass: Read through data files ***/
/* This pass serves to set the xrange and to parse the command, as well 
 * as filling in every thing except the function data. That is done after
 * the xrange is defined.
 */
	while (TRUE) {
		if (END_OF_COMMAND)
			int_error("function to plot expected",c_token);

		start_token = c_token;

		if (is_definition(c_token)) {
			define();
		} else {
			plot_num++;

			if (isstring(c_token)) {			/* data file to plot */
				if (parametric && xparam) 
					int_error("previous parametric function not fully specified",
																	c_token);

				if (!some_data_files && autoscale_lx) {
				    xmin = VERYLARGE;
				    xmax = -VERYLARGE;
				}
				some_data_files = TRUE;

				if (*tp_ptr)
				  this_plot = *tp_ptr;
				else {		/* no memory malloc()'d there yet */
				    this_plot = cp_alloc(MIN_CRV_POINTS);
				    *tp_ptr = this_plot;
				}
				this_plot->plot_type = DATA;
				this_plot->plot_style = data_style;
				end_token = c_token;
				get_data(this_plot); /* this also parses the using option */
			} 
			else {							/* function to plot */
				if (parametric)			/* working on x parametric function */
					xparam = 1 - xparam;
				if (*tp_ptr) {
				    this_plot = *tp_ptr;
				    cp_extend(this_plot, samples+1);
				} else {		/* no memory malloc()'d there yet */
				    this_plot = cp_alloc(samples+1);
				    *tp_ptr = this_plot;
				}
				this_plot->plot_type = FUNC;
				this_plot->plot_style = func_style;
				dummy_func = &plot_func;
				plot_func.at = temp_at();
				/* ignore it for now */
				end_token = c_token-1;
			}

			if (almost_equals(c_token,"t$itle")) {
				if (parametric) {
					if (xparam) 
						int_error(
		"\"title\" allowed only after parametric function fully specified",
																	c_token);
					else if (xtitle != NULL)
						xtitle[0] = '\0';  /* Remove default title .*/
				}
				c_token++;
				if ( isstring( c_token ) ) {
					m_quote_capture(&(this_plot->title),c_token,c_token);
				}
				else {
					int_error("expecting \"title\" for plot",c_token);
				}
				c_token++;
			}
  			else {
  				m_capture(&(this_plot->title),start_token,end_token);
 				if (xparam) xtitle = this_plot->title;
  			}
  
  			this_plot->line_type = line_num;
			this_plot->point_type = point_num;

			if (almost_equals(c_token,"w$ith")) {
				if (parametric && xparam) 
					int_error("\"with\" allowed only after parametric function fully specified",
									c_token);
			    this_plot->plot_style = get_style();
			}

			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				this_plot->line_type = (int)real(const_express(&t))-1;
			}
			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				this_plot->point_type = (int)real(const_express(&t))-1;
			}
			if ( (this_plot->plot_style == POINTS) ||
				 (this_plot->plot_style == LINESPOINTS) ||
				 (this_plot->plot_style == ERRORBARS) )
					if (!xparam) point_num++;
			if (!xparam) line_num++;

			if (this_plot->plot_type == DATA) 
			  /* now that we know the plot style, adjust the yrange */
			  adjust_yrange(this_plot);

			tp_ptr = &(this_plot->next_cp);
		}

		if (equals(c_token,",")) 
			c_token++;
		else  
			break;
	}

	if (parametric && xparam) 
		int_error("parametric function not fully specified", NO_CARET);

	if (parametric) {
	/* Swap t and x ranges for duration of these eval_plot computations. */
		ltmp = autoscale_lx; autoscale_lx = autoscale_lt; autoscale_lt = ltmp;
		temp = xmin; xmin = tmin; tmin = temp;
		temp = xmax; xmax = tmax; tmax = temp;
	}

/*** Second Pass: Evaluate the functions ***/
/* Everything is defined now, except the function data. We expect
 * no syntax errors, etc, since the above parsed it all. This makes 
 * the code below simpler. If autoscale_ly, the yrange may still change.
 */
     if (fabs(xmax-xmin) < zero)
	  if (autoscale_lx) {
		 fprintf(stderr, "Warning: empty %c range [%g:%g], ", 
			parametric ? 't' : 'x', xmin,xmax);
		 if (fabs(xmin) < zero) {
			/* completely arbitary */
			xmin = -1.;
			xmax = 1.;
		 } else {
			/* expand range by 10% in either direction */
			xmin = xmin * 0.9;
			xmax = xmax * 1.1;
		 }
		 fprintf(stderr, "adjusting to [%g:%g]\n", xmin,xmax);
	  } else {
		 int_error("x range is less than `zero`", c_token);
	  }

	/* give error if xrange badly set from missing datafile error */
	if (xmin == VERYLARGE || xmax == -VERYLARGE) {
		int_error("x range is invalid", c_token);
	}

    if (log_x) {
	   if (xmin <= 0.0 || xmax <= 0.0)
		int_error("x range must be greater than 0 for log scale!",NO_CARET);
	   x_min = log10(xmin);
	   x_max = log10(xmax);
    } else {
	   x_min = xmin;
	   x_max = xmax;
    }

    xdiff = (x_max - x_min) / (samples - 1);

    tp_ptr = &(first_plot);
    plot_num = 0;
    this_plot = first_plot;
    c_token = begin_token;	/* start over */

    /* Read through functions */
	while (TRUE) {
		if (is_definition(c_token)) {
			define();
		} else {
			plot_num++;
			if (isstring(c_token)) {			/* data file to plot */
			    /* ignore this now */
				c_token++;
				if (almost_equals(c_token,"u$sing")) {
					c_token++;  	/* skip "using" */
						if (!isstring(c_token)) {
						struct value a;
						(void)magnitude(const_express(&a)); /* skip xcol */
						if (equals(c_token,":")) {
							c_token++;      /* skip ":" */
							(void)magnitude(const_express(&a)); /* skip ycol */
						}
						if (equals(c_token,":")) {
							c_token++;      /* skip ":" */
							(void)magnitude(const_express(&a)); /* skip yemin */
						}
						if (equals(c_token,":")) {
							c_token++;      /* skip ":" */
							(void)magnitude(const_express(&a)); /* skip yemax */
						}
					}
					if (isstring(c_token))
						c_token++;      /* skip format string */
				}
			}
			else {					/* function to plot */
				if (parametric)			/* working on x parametric function */
					xparam = 1 - xparam;
				dummy_func = &plot_func;
				plot_func.at = temp_at(); /* reparse function */

				for (i = 0; i < samples; i++) {
				    x = x_min + i*xdiff;
				    /* if (log_x) PEM fix logscale x axis */
				    /* x = pow(10.0,x); 26-Sep-89 */
				    (void) complex(&plot_func.dummy_values[0],
							    log_x ? pow(10.0,x) : x,
							    0.0);

				    evaluate_at(plot_func.at,&a);

				    if (undefined || (fabs(imag(&a)) > zero)) {
					   this_plot->points[i].type = UNDEFINED;
					   continue;
				    }

				    temp = real(&a);

				    if (log_y && temp < 0.0) {
					   this_plot->points[i].type = UNDEFINED;
					   continue;
				    }

				    this_plot->points[i].x = x;
				    if (log_y) {
					   if (temp == 0.0) {
						  this_plot->points[i].type = OUTRANGE;
						  this_plot->points[i].y = -VERYLARGE;
						  continue;
					   } else {
						  this_plot->points[i].y = log10(temp);
					   }
				    } else
					 this_plot->points[i].y = temp;

				    if (autoscale_ly || polar
					   || inrange(temp, ymin, ymax)) {
					   this_plot->points[i].type = INRANGE;
					/* When xparam is 1 we are not really computing y's! */
						if (!xparam && autoscale_ly) {
					   	if (temp < ymin) ymin = temp;
					   	if (temp > ymax) ymax = temp;
						}
				    } else
					 this_plot->points[i].type = OUTRANGE;
				}
				this_plot->p_count = i; /* samples */
			 }

			/* title was handled above */
			if (almost_equals(c_token,"t$itle")) {
				c_token++;
				c_token++;
			}

			/* style was handled above */
			if (almost_equals(c_token,"w$ith")) {
			    c_token++;
			    c_token++;
			}

			/* line and point types were handled above */
			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				(void)real(const_express(&t));
			}
			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				(void)real(const_express(&t));
			}

 			tp_ptr = &(this_plot->next_cp); /* used below */
			this_plot = this_plot->next_cp;
		 }
		
		if (equals(c_token,",")) 
		  c_token++;
		else  
		  break;
	 }

    /* throw out all curve_points at end of list, that we don't need  */
    cp_free(*tp_ptr);
    *tp_ptr = NULL;

    if (fabs(ymax - ymin) < zero)
	 /* if autoscale, widen range */
	 if (autoscale_ly) {
		fprintf(stderr, "Warning: empty y range [%g:%g], ", ymin, ymax);
		if (fabs(ymin) < zero) {
		    ymin = -1.;
		    ymax = 1.;
		} else {
		    /* expand range by 10% in either direction */
		    ymin = ymin * 0.9;
		    ymax = ymax * 1.1;
		}
		fprintf(stderr, "adjusting to [%g:%g]\n", ymin, ymax);
	 } else {
		int_error("y range is less than `zero`", c_token);
	 }

/* Now we finally know the real ymin and ymax */
	if (log_y) {
		y_min = log10(ymin);
		y_max = log10(ymax);
	} else {
		y_min = ymin;
		y_max = ymax;
	}
	capture(replot_line,plot_token,c_token);

	if (parametric) {
	/* Now put t and x ranges back before we actually plot anything. */
		ltmp = autoscale_lx; autoscale_lx = autoscale_lt; autoscale_lt = ltmp;
		temp = xmin; xmin = tmin; tmin = temp;
		temp = xmax; xmax = tmax; tmax = temp;
		if (some_data_files && autoscale_lx) {
		/* 
			Stop any further autoscaling in this case (may be a mistake, have
  			to consider what is really wanted some day in the future--jdc). 
		*/
		    autoscale_lx = 0;
		}
	/* Now actually fix the plot pairs to be single plots. */
		parametric_fixup (first_plot, &plot_num, &x_min, &x_max);
	}

	if (strcmp(term_tbl[term].name,"table") == 0)
		print_table();
	else
		do_plot(first_plot,plot_num,x_min,x_max,y_min,y_max);
	cp_free(first_plot);
	first_plot = NULL;
}

/* This parses the splot command after any range specifications. 
 * To support autoscaling on the x/z axis, we want any data files to 
 * define the x/y range, then to plot any functions using that range. 
 * We thus parse the input twice, once to pick up the data files, 
 * and again to pick up the functions. Definitions are processed 
 * twice, but that won't hurt.
 */
eval_3dplots()
{
register int i,j,k;
register struct surface_points *this_plot, **tp_3d_ptr;
register int start_token, end_token;
register int begin_token;
double x_min, x_max, y_min, y_max, z_min, z_max;
register double x, xdiff, xisodiff, y, ydiff, yisodiff, temp;
static struct value a;
BOOLEAN ltmp, some_data_files = FALSE;
int plot_num, line_num, point_num,
    crnt_param = 0; /* 0=x, 1=y, 2=z */
char *xtitle;
char *ytitle;
void parametric_3dfixup();

	if (autoscale_lz) {
		zmin = VERYLARGE;
		zmax = -VERYLARGE;
	} else if (log_z && (zmin <= 0.0 || zmax <= 0.0))
			int_error("z range must be above 0 for log scale!",
				NO_CARET);

	tp_3d_ptr = &(first_3dplot);
	plot_num = 0;
	line_num = 0; 	/* default line type */
	point_num = 0;	/* default point type */

	xtitle = NULL;
	ytitle = NULL;

	begin_token = c_token;

/*** First Pass: Read through data files ***/
/* This pass serves to set the x/yranges and to parse the command, as well 
 * as filling in every thing except the function data. That is done after
 * the x/yrange is defined.
 */
	while (TRUE) {
		if (END_OF_COMMAND)
			int_error("function to plt3d expected",c_token);

		start_token = c_token;

		if (is_definition(c_token)) {
			define();
		} else {
			plot_num++;

			if (isstring(c_token)) {			/* data file to plot */
				if (parametric && crnt_param != 0)
					int_error("previous parametric function not fully specified",
																	c_token);

				if (!some_data_files) {
					if (autoscale_lx) {
						xmin = VERYLARGE;
						xmax = -VERYLARGE;
					}
					if (autoscale_ly) {
						ymin = VERYLARGE;
						ymax = -VERYLARGE;
					}
				}

				some_data_files = TRUE;

				if (*tp_3d_ptr)
				    this_plot = *tp_3d_ptr;
				else {	/* no memory malloc()'d there yet */
				    /* Allocate samples * iso_samples twice for */
				    /* Each of the isoparametric direction. */
				    this_plot = sp_alloc(0,0);
				    *tp_3d_ptr = this_plot;
				}

				this_plot->plot_type = DATA3D;
				this_plot->plot_style = data_style;
				end_token = c_token;
				get_3ddata(this_plot); /* this also parses the using option */
			} 
			else {						/* function to plot */
				if (parametric) /* Rotate between x/y/z axes */
					crnt_param = (crnt_param+1) % 3;
				if (*tp_3d_ptr) {
				    this_plot = *tp_3d_ptr;
				    sp_replace(this_plot,samples,2*iso_samples);
				}
				else {	/* no memory malloc()'d there yet */
				    /* Allocate samples * iso_samples twice for */
				    /* Each of the isoparametric direction. */
				    this_plot = sp_alloc(samples,2*iso_samples);
				    *tp_3d_ptr = this_plot;
				}

				this_plot->plot_type = FUNC3D;
				this_plot->has_grid_topology = TRUE;
				this_plot->plot_style = func_style;
				dummy_func = &plot_func;
				plot_func.at = temp_at();
				/* ignore it for now */
				end_token = c_token-1;
			}

			if (almost_equals(c_token,"t$itle")) {
				if (parametric) {
				        if (crnt_param)
						int_error(
		"\"title\" allowed only after parametric function fully specified",
																	c_token);
					else {
						/* Remove default title */
						if (xtitle != NULL)
							xtitle[0] = '\0';
						if (ytitle != NULL)
							ytitle[0] = '\0';
					}
			        }
				c_token++;
				if ( isstring( c_token ) ) {
					m_quote_capture(&(this_plot->title),c_token,c_token);
				}
				else {
					int_error("expecting \"title\" for plot",c_token);
				}
				c_token++;
			}
  			else {
  				m_capture(&(this_plot->title),start_token,end_token);
				if (crnt_param == 1) xtitle = this_plot->title;
				if (crnt_param == 2) ytitle = this_plot->title;
  			}
  
  			this_plot->line_type = line_num;
			this_plot->point_type = point_num;

			if (almost_equals(c_token,"w$ith")) {
			    this_plot->plot_style = get_style();
			}

			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				this_plot->line_type = (int)real(const_express(&t))-1;
			}
			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				this_plot->point_type = (int)real(const_express(&t))-1;
			}
			if ( (this_plot->plot_style == POINTS) ||
				 (this_plot->plot_style == LINESPOINTS) ||
				 (this_plot->plot_style == ERRORBARS) )
					if (crnt_param == 0)
						point_num +=
						    1 + (draw_contour != 0)
						      + (hidden3d != 0);
			if (crnt_param == 0)
			    line_num += 1 + (draw_contour != 0)
			                  + (hidden3d != 0);

			tp_3d_ptr = &(this_plot->next_sp);
		}

		if (equals(c_token,",")) 
			c_token++;
		else  
			break;
	}

	if (parametric && crnt_param != 0)
		int_error("parametric function not fully specified", NO_CARET);

	if (parametric) {
	/* Swap u/v and x/y ranges for duration of these eval_plot computations. */
		ltmp = autoscale_lx; autoscale_lx = autoscale_lu; autoscale_lu = ltmp;
		ltmp = autoscale_ly; autoscale_ly = autoscale_lv; autoscale_lv = ltmp;
		temp = xmin; xmin = umin; umin = temp;
		temp = xmax; xmax = umax; umax = temp;
		temp = ymin; ymin = vmin; vmin = temp;
		temp = ymax; ymax = vmax; vmax = temp;
	}
/*** Second Pass: Evaluate the functions ***/
/* Everything is defined now, except the function data. We expect
 * no syntax errors, etc, since the above parsed it all. This makes 
 * the code below simpler. If autoscale_ly, the yrange may still change.
 */
     if (xmin == xmax)
	  if (autoscale_lx) {
		 fprintf(stderr, "Warning: empty x range [%g:%g], ", 
			 xmin,xmax);
		 if (xmin == 0.0) {
			/* completely arbitary */
			xmin = -1.;
			xmax = 1.;
		 } else {
			/* expand range by 10% in either direction */
			xmin = xmin * 0.9;
			xmax = xmax * 1.1;
		 }
		 fprintf(stderr, "adjusting to [%g:%g]\n", xmin,xmax);
	  } else {
		 int_error("x range is empty", c_token);
	  }

     if (ymin == ymax)
	  if (autoscale_ly) {
		 fprintf(stderr, "Warning: empty y range [%g:%g], ", 
			ymin,ymax);
		 if (ymin == 0.0) {
			/* completely arbitary */
			ymin = -1.;
			ymax = 1.;
		 } else {
			/* expand range by 10% in either direction */
			ymin = ymin * 0.9;
			ymax = ymax * 1.1;
		 }
		 fprintf(stderr, "adjusting to [%g:%g]\n", ymin,ymax);
	  } else {
		 int_error("y range is empty", c_token);
	  }

    /* give error if xrange badly set from missing datafile error */
    if (xmin == VERYLARGE || xmax == -VERYLARGE) {
	int_error("x range is invalid", c_token);
    }

    if (log_x) {
	   if (xmin <= 0.0 || xmax <= 0.0)
		int_error("x range must be greater than 0 for log scale!",NO_CARET);
	   x_min = log10(xmin);
	   x_max = log10(xmax);
    } else {
	   x_min = xmin;
	   x_max = xmax;
    }

    if (log_y) {
	   if (ymin <= 0.0 || ymax <= 0.0)
		int_error("y range must be greater than 0 for log scale!",NO_CARET);
	   y_min = log10(ymin);
	   y_max = log10(ymax);
    } else {
	   y_min = ymin;
	   y_max = ymax;
    }

    if (samples < 2 || iso_samples < 2)
	int_error("samples or iso_samples < 2. Must be at least 2.\n");

    xdiff = (x_max - x_min) / (samples - 1);
    ydiff = (y_max - y_min) / (samples - 1);
    xisodiff = (x_max - x_min) / (iso_samples - 1);
    yisodiff = (y_max - y_min) / (iso_samples - 1);

    plot_num = 0;
    this_plot = first_3dplot;
    c_token = begin_token;	/* start over */

    /* Read through functions */
	while (TRUE) {
		if (is_definition(c_token)) {
			define();
		} else {
			plot_num++;
			if (isstring(c_token)) {			/* data file to plot */
			    /* ignore this now */
				c_token++;
				if (almost_equals(c_token,"u$sing")) {
					c_token++;  	/* skip "using" */
                    			if (!isstring(c_token)) {
						struct value a;
						(void)magnitude(const_express(&a));	/* skip xcol */
						if (equals(c_token,":")) {
							c_token++;	/* skip ":" */
							(void)magnitude(const_express(&a));	/* skip ycol */
							if (equals(c_token,":")) {
								c_token++;	/* skip ":" */
								(void)magnitude(const_express(&a));	/* skip zcol */
							}
						}
					}
                    			if (isstring(c_token))
						c_token++;	/* skip format string */
				}
			}
			else {					/* function to plot */
				struct iso_curve *this_iso = this_plot->iso_crvs;
				struct coordinate *points = this_iso->points;
				
				if (parametric)
					crnt_param = (crnt_param+1) % 3;
				dummy_func = &plot_func;
				plot_func.at = temp_at(); /* reparse function */

				for (j = 0; j < iso_samples; j++) {
				    y = y_min + j*yisodiff;
				    /* if (log_y) PEM fix logscale y axis */
				    /* y = pow(10.0,y); 26-Sep-89 */
				    (void) complex(&plot_func.dummy_values[1],
							    log_y ? pow(10.0,y) : y,
							    0.0);

				    for (i = 0; i < samples; i++) {
				        x = x_min + i*xdiff;
				        /* if (log_x) PEM fix logscale x axis */
				        /* x = pow(10.0,x); 26-Sep-89 */
				        (void) complex(&plot_func.dummy_values[0],
							    log_x ? pow(10.0,x) : x,
							    0.0);

				        points[i].x = x;
				        points[i].y = y;

				        evaluate_at(plot_func.at,&a);

				        if (undefined || (fabs(imag(&a)) > zero)) {
					   points[i].type = UNDEFINED;
					   continue;
				        }

				        temp = real(&a);

				        if (log_z && temp < 0.0) {
					   points[i].type = UNDEFINED;
					   continue;
				        }

				        if (log_z) {
					   if (temp == 0.0) {
						  points[i].type = OUTRANGE;
						  points[i].z = -VERYLARGE;
						  continue;
					   } else {
						  points[i].z = log10(temp);
					   }
				        } else
					   points[i].z = temp;

				        if (autoscale_lz
					   || inrange(temp, zmin, zmax)) {
					   points[i].type = INRANGE;
					   if (autoscale_lz) {
					      if (temp < zmin) zmin = temp;
					      if (temp > zmax) zmax = temp;
					   }
				        } else
					   points[i].type = OUTRANGE;
				    }
				    this_iso->p_count = samples;
				    this_iso = this_iso->next;
				    points = this_iso->points;
				}

				for (i = 0; i < iso_samples; i++) {
				    x = x_min + i*xisodiff;
				    /* if (log_x) PEM fix logscale x axis */
				    /* x = pow(10.0,x); 26-Sep-89 */
				    (void) complex(&plot_func.dummy_values[0],
							    log_x ? pow(10.0,x) : x,
							    0.0);

				    for (j = 0; j < samples; j++) {
				        y = y_min + j*ydiff;
				        /* if (log_y) PEM fix logscale y axis */
				        /* y = pow(10.0,y); 26-Sep-89 */
				        (void) complex(&plot_func.dummy_values[1],
							    log_y ? pow(10.0,y) : y,
							    0.0);

				        points[j].x = x;
				        points[j].y = y;

				        evaluate_at(plot_func.at,&a);

				        if (undefined || (fabs(imag(&a)) > zero)) {
					   points[j].type = UNDEFINED;
					   continue;
				        }

				        temp = real(&a);

				        if (log_z && temp < 0.0) {
					   points[j].type = UNDEFINED;
					   continue;
				        }

				        if (log_z) {
					   if (temp == 0.0) {
						  points[j].type = OUTRANGE;
						  points[j].z = -VERYLARGE;
						  continue;
					   } else {
						  points[j].z = log10(temp);
					   }
				        } else
					   points[j].z = temp;

				        if (autoscale_lz
					   || inrange(temp, zmin, zmax)) {
					   points[j].type = INRANGE;
					   if (autoscale_lz) {
					      if (temp < zmin) zmin = temp;
					      if (temp > zmax) zmax = temp;
					   }
				        } else
					   points[j].type = OUTRANGE;
				    }
    				    this_iso->p_count = samples;
				    this_iso = this_iso->next;
				    points = this_iso ? this_iso->points : NULL;
				}
			 }

			/* title was handled above */
			if (almost_equals(c_token,"t$itle")) {
				c_token++;
				c_token++;
			}

			/* style was handled above */
			if (almost_equals(c_token,"w$ith")) {
			    c_token++;
			    c_token++;
			}

			/* line and point types were handled above */
			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				(void)real(const_express(&t));
			}
			if ( !equals(c_token,",") && !END_OF_COMMAND ) {
				struct value t;
				(void)real(const_express(&t));
			}

			this_plot = this_plot->next_sp;
		 }

		if (equals(c_token,","))
		  c_token++;
		else
		  break;
	 }

    if (fabs(zmax - zmin) < zero)
	 /* if autoscale, widen range */
	 if (autoscale_lz) {
		fprintf(stderr, "Warning: empty z range [%g:%g], ", zmin, zmax);
		if (fabs(zmin) < zero ) {
		    zmin = -1.;
		    zmax = 1.;
		} else {
		    /* expand range by 10% in either direction */
		    zmin = zmin * 0.9;
		    zmax = zmax * 1.1;
		}
		fprintf(stderr, "adjusting to [%g:%g]\n", zmin, zmax);
	 } else {
		int_error("z range is less than `zero`", c_token);
	 }

/* Now we finally know the real zmin and zmax */
	if (log_z) {
		if (zmin <= 0.0 || zmax <= 0.0)
			int_error("z range must be greater than 0 for log scale!",NO_CARET);
		z_min = log10(zmin);
		z_max = log10(zmax);
	} else {
		z_min = zmin;
		z_max = zmax;
	}
	capture(replot_line,plot_token,c_token);

	if (parametric) {
	/* Now put u/v and x/y ranges back before we actually plot anything. */
		ltmp = autoscale_lx; autoscale_lx = autoscale_lu; autoscale_lu = ltmp;
		ltmp = autoscale_ly; autoscale_ly = autoscale_lv; autoscale_lv = ltmp;
		temp = xmin; xmin = umin; umin = temp;
		temp = xmax; xmax = umax; umax = temp;
		temp = ymin; ymin = vmin; vmin = temp;
		temp = ymax; ymax = vmax; vmax = temp;

	/* Now actually fix the plot triplets to be single plots. */
		parametric_3dfixup(first_3dplot, &plot_num,
				   &x_min, &x_max, &y_min, &y_max,
				   &z_min, &z_max);
		if (log_x) {
			if (x_min <= 0.0 || x_max <= 0.0)
				int_error("x range must be greater than 0 for log scale!",NO_CARET);
			x_min = log10(x_min);
			x_max = log10(x_max);
		}

		if (log_y) {
			if (y_min <= 0.0 || y_max <= 0.0)
				int_error("y range must be greater than 0 for log scale!",NO_CARET);
			y_min = log10(y_min);
			y_max = log10(y_max);
		}

		if (log_z) {
			if (z_min <= 0.0 || z_max <= 0.0)
				int_error("z range must be greater than 0 for log scale!",NO_CARET);
			z_min = log10(z_min);
			z_max = log10(z_max);
		}
	}


	/* Creates contours if contours are to be plotted as well. */
	if (draw_contour) {
		for (this_plot=first_3dplot, i=0;
		     i < plot_num;
		     this_plot=this_plot->next_sp, i++) {
			if (this_plot->contours) {
				struct gnuplot_contours *cntr, *cntrs = this_plot->contours;

				while (cntrs) {
					cntr = cntrs;
					cntrs = cntrs->next;
					free(cntr->coords);
					free(cntr);
				}
			}
			/* Make sure this one can be contoured. */
			if (!this_plot->has_grid_topology) {
			    this_plot->contours = NULL;
			    int_error("Can not contour non grid data!",NO_CARET);
			}
			if (this_plot->plot_type == DATA3D)
			    this_plot->contours = contour(
					       this_plot->num_iso_read,
					       this_plot->iso_crvs,
					       contour_levels, contour_pts,
					       contour_kind, contour_order);
			else
			    this_plot->contours = contour(iso_samples,
					       this_plot->iso_crvs,
					       contour_levels, contour_pts,
					       contour_kind, contour_order);
		}
	}

	if (strcmp(term_tbl[term].name,"table") == 0)
	   print_3dtable();
	else
	   do_3dplot(first_3dplot,plot_num,x_min,x_max,y_min,y_max,z_min,z_max);
	sp_free(first_3dplot);
	first_3dplot = NULL;
}

done(status)
int status;
{
	if (term && term_init)
		(*term_tbl[term].reset)();
#ifdef vms
	vms_reset();
#endif
	exit(status);
}

void parametric_fixup (start_plot, plot_num, x_min, x_max)
struct curve_points *start_plot;
int *plot_num;
double *x_min, *x_max;
/*
	The hardest part of this routine is collapsing the FUNC plot types
   in the list (which are gauranteed to occur in (x,y) pairs while 
	preserving the non-FUNC type plots intact.  This means we have to
	work our way through various lists.  Examples (hand checked):
		start_plot:F1->F2->NULL ==> F2->NULL
		start_plot:F1->F2->F3->F4->F5->F6->NULL ==> F2->F4->F6->NULL
		start_plot:F1->F2->D1->D2->F3->F4->D3->NULL ==> F2->D1->D2->F4->D3->NULL
	
	Of course, the more interesting work is to move the y values of
	the x function to become the x values of the y function (checking
	the mins and maxs as we go along).
*/
{
	struct curve_points *xp, *new_list, *yp = start_plot, *tmp, 
			*free_list, *free_head=NULL;
	int i, tlen, curve; 
	char *new_title;
	double lxmin, lxmax, temp;

	if (autoscale_lx) {
		lxmin = VERYLARGE;
		lxmax = -VERYLARGE;
	} else {
		lxmin = xmin;
		lxmax = xmax;
	}

/* 
	Ok, go through all the plots and move FUNC types together.  Note: this
	originally was written to look for a NULL next pointer, but gnuplot 
	wants to be sticky in grabbing memory and the right number of items
	in the plot list is controlled by the plot_num variable.

	Since gnuplot wants to do this sticky business, a free_list of 
	curve_points is kept and then tagged onto the end of the plot list as
	this seems more in the spirit of the original memory behavior than
	simply freeing the memory.  I'm personally not convinced this sort
	of concern is worth it since the time spent computing points seems
	to dominate any garbage collecting that might be saved here...
*/
	new_list = xp = start_plot; 
	yp = xp->next_cp;
   curve = 0;
	for (; curve < *plot_num; xp = xp->next_cp,yp = yp->next_cp,curve++) {
		if (xp->plot_type != FUNC) {
			continue;
		}
	/* Here's a FUNC parametric function defined as two parts. */
		--(*plot_num);
	/* 
		Go through all the points assigning the y's from xp to be the
		x's for yp.  Check max's and min's as you go.
	*/
		for (i = 0; i < yp->p_count; ++i) {
		/* 
			Throw away excess xp points, mark excess yp points as OUTRANGE.
		*/
			if (i > xp->p_count) {
				yp->points[i].type = OUTRANGE;
				continue;
			}
		/* 
			Just as we had to do when we computed y values--now check that
			x's (computed parametrically) are in the permitted ranges as well.
		*/
			temp = xp->points[i].y;   /* New x value for yp function. */
			yp->points[i].x = temp;
		/* Handle undefined values differently from normal ranges. */
			if (xp->points[i].type == UNDEFINED)
				yp->points[i].type = xp->points[i].type;  
			if (autoscale_lx || polar
					   || inrange(temp, lxmin, lxmax)) {
			   if (autoscale_lx && temp < lxmin) lxmin = temp;
				if (autoscale_lx && temp > lxmax) lxmax = temp;
			} else
			yp->points[i].type = OUTRANGE;  /* Due to x value. */
		}
   /* Ok, fix up the title to include both the xp and yp plots. */
		if (xp->title && xp->title[0] != '\0') {
			tlen = strlen (yp->title) + strlen (xp->title) + 3;
      	new_title = alloc ((unsigned int) tlen, "string");
			strcpy (new_title, xp->title);  
			strcat (new_title, ", ");       /* + 2 */
			strcat (new_title, yp->title);  /* + 1 = + 3 */
			free (yp->title);
			yp->title = new_title;
		}
	/* Eliminate the first curve (xparam) and just use the second. */
		if (xp == start_plot) {
		/* Simply nip off the first element of the list. */
			new_list = first_plot = yp;
			xp = xp->next_cp;
			if (yp->next_cp != NULL)
				yp = yp->next_cp;
		/* Add start_plot to the free_list. */
			if (free_head == NULL) {
				free_list = free_head = start_plot;
				free_head->next_cp = NULL;
			} else {
				free_list->next_cp = start_plot;
				start_plot->next_cp = NULL;
				free_list = start_plot;
			}
		}
		else {
		/* Here, remove the xp node and replace it with the yp node. */
			tmp = xp;
		/* Pass over any data files that might have been in place. */
			while (new_list->next_cp && new_list->next_cp != xp) 
				new_list = new_list->next_cp;
			new_list->next_cp = yp;
			new_list = new_list->next_cp;
			xp = xp->next_cp;
			if (yp->next_cp != NULL)
				yp = yp->next_cp;
		/* Add tmp to the free_list. */
			tmp->next_cp = NULL;
			if (free_head == NULL) {
				free_list = free_head = tmp;
			} else {
				free_list->next_cp = tmp;
				free_list = tmp;
			}
		}
	}
/* Ok, stick the free list at the end of the curve_points plot list. */
	while (new_list->next_cp != NULL)
		new_list = new_list->next_cp;
	new_list->next_cp = free_head;

/* Report the overall graph mins and maxs. */
	*x_min = lxmin;
	*x_max = lxmax;
}

void parametric_3dfixup(start_plot, plot_num, x_min, x_max, y_min, y_max,
							    z_min, z_max)
struct surface_points *start_plot;
int *plot_num;
double *x_min, *x_max, *y_min, *y_max, *z_min, *z_max;
/*
	The hardest part of this routine is collapsing the FUNC plot types
   in the list (which are gauranteed to occur in (x,y,z) triplets while 
	preserving the non-FUNC type plots intact.  This means we have to
	work our way through various lists.  Examples (hand checked):
		start_plot:F1->F2->F3->NULL ==> F3->NULL
		start_plot:F1->F2->F3->F4->F5->F6->NULL ==> F3->F6->NULL
		start_plot:F1->F2->F3->D1->D2->F4->F5->F6->D3->NULL ==>
						F3->D1->D2->F6->D3->NULL
*/
{
	struct surface_points *xp, *yp, *zp, *new_list, *tmp, 
			*free_list, *free_head=NULL;
	struct iso_curve *icrvs, *xicrvs, *yicrvs, *zicrvs;
	int i, tlen, surface;
	char *new_title;
	double lxmin, lxmax, lymin, lymax, lzmin, lzmax, temp;

	if (autoscale_lx) {
		lxmin = VERYLARGE;
		lxmax = -VERYLARGE;
	} else {
		lxmin = xmin;
		lxmax = xmax;
	}

	if (autoscale_ly) {
		lymin = VERYLARGE;
		lymax = -VERYLARGE;
	} else {
		lymin = ymin;
		lymax = ymax;
	}

	if (autoscale_lz) {
		lzmin = VERYLARGE;
		lzmax = -VERYLARGE;
	} else {
		lzmin = zmin;
		lzmax = zmax;
	}

/* 
	Ok, go through all the plots and move FUNC3D types together.  Note:
	this originally was written to look for a NULL next pointer, but
	gnuplot wants to be sticky in grabbing memory and the right number
	of items in the plot list is controlled by the plot_num variable.

	Since gnuplot wants to do this sticky business, a free_list of 
	surface_points is kept and then tagged onto the end of the plot list as
	this seems more in the spirit of the original memory behavior than
	simply freeing the memory.  I'm personally not convinced this sort
	of concern is worth it since the time spent computing points seems
	to dominate any garbage collecting that might be saved here...
*/
	new_list = xp = start_plot; 
	for (surface = 0; surface < *plot_num; surface++) {
		if (xp->plot_type != FUNC3D) {
			icrvs = xp->iso_crvs;

			while ( icrvs ) {
				struct coordinate *points = icrvs->points;

				for (i = 0; i < icrvs->p_count; ++i) {
					if (lxmin > points[i].x)
						lxmin = points[i].x;
					if (lxmax < points[i].x)
						lxmax = points[i].x;
					if (lymin > points[i].y)
						lymin = points[i].y;
					if (lymax < points[i].y)
						lymax = points[i].y;
					if (lzmin > points[i].z)
						lzmin = points[i].z;
					if (lzmax < points[i].z)
						lzmax = points[i].z;
				}

				icrvs = icrvs->next;
			}
			xp = xp->next_sp;
			continue;
		}

		yp = xp->next_sp;
		zp = yp->next_sp;

	/* Here's a FUNC3D parametric function defined as three parts. */
		(*plot_num) -= 2;
	/* 
		Go through all the points and assign the x's and y's from xp
		and yp to zp.  Check max's and min's as you go.
	*/
		xicrvs = xp->iso_crvs;
		yicrvs = yp->iso_crvs;
		zicrvs = zp->iso_crvs;
		while ( zicrvs ) {
			struct coordinate *xpoints = xicrvs->points,
				     *ypoints = yicrvs->points,
				     *zpoints = zicrvs->points;
			for (i = 0; i < zicrvs->p_count; ++i) {
				zpoints[i].x = xpoints[i].z;
				zpoints[i].y = ypoints[i].z;

				if (lxmin > zpoints[i].x) lxmin = zpoints[i].x;
				if (lxmax < zpoints[i].x) lxmax = zpoints[i].x;
				if (lymin > zpoints[i].y) lymin = zpoints[i].y;
				if (lymax < zpoints[i].y) lymax = zpoints[i].y;
				if (lzmin > zpoints[i].z) lzmin = zpoints[i].z;
				if (lzmax < zpoints[i].z) lzmax = zpoints[i].z;
			}
			xicrvs = xicrvs->next;
			yicrvs = yicrvs->next;
			zicrvs = zicrvs->next;
		}

	/* Ok, fix up the title to include xp and yp plots. */
		if ((xp->title && xp->title[0] != '\0') ||
		    (yp->title && yp->title[0] != '\0')) {
			tlen = (xp->title ? strlen(xp->title) : 0) +
			       (yp->title ? strlen(yp->title) : 0) +
			       (zp->title ? strlen(zp->title) : 0) + 5;
			new_title = alloc ((unsigned int) tlen, "string");
			new_title[0] = 0;
			if (xp->title) {
				strcat(new_title, xp->title);
				strcat(new_title, ", ");       /* + 2 */
			}
			if (yp->title) {
				strcat(new_title, yp->title);
				strcat(new_title, ", ");       /* + 2 */
			}
			if (zp->title) {
				strcat(new_title, zp->title);
			}
			free (zp->title);
			zp->title = new_title;
		}

	/* Eliminate the first two surfaces (xp and yp) and just use the third. */
		if (xp == start_plot) {
		/* Simply nip off the first two elements of the list. */
			new_list = first_3dplot = zp;
			xp = zp->next_sp;
		/* Add xp and yp to the free_list. */
			if (free_head == NULL) {
				free_head = start_plot;
			} else {
				free_list->next_sp = start_plot;
			}
			free_list = start_plot->next_sp;
			free_list->next_sp = NULL;
		}
		else {
		/* Here, remove the xp,yp nodes and replace them with the zp node. */
			tmp = xp;
		/* Pass over any data files that might have been in place. */
			while (new_list->next_sp && new_list->next_sp != xp)
				new_list = new_list->next_sp;
			new_list->next_sp = zp;
			new_list = zp;
			xp = zp->next_sp;
		/* Add tmp to the free_list. */
			if (free_head == NULL) {
				free_head = tmp;
			} else {
				free_list->next_sp = tmp;
			}
			free_list = tmp->next_sp;
			free_list->next_sp = NULL;
		}
	}
/* Ok, stick the free list at the end of the surface_points plot list. */
	while (new_list->next_sp != NULL)
		new_list = new_list->next_sp;
	new_list->next_sp = free_head;
      if (lxmax - lxmin < zero) {
          if (fabs(lxmax) < zero) {
              lxmin = -1.0;
              lxmax = 1.0;
          }
          else {
              lxmin *= 0.9;
              lxmax *= 1.1;
          }
      }
      if (lymax - lymin < zero) {
          if (fabs(lymax) < zero) {
              lymin = -1.0;
              lymax = 1.0;
          }
          else {
              lymin *= 0.9;
              lymax *= 1.1;
          }
      }
      if (lzmax - lzmin < zero) {
          if (fabs(lzmax) < zero) {
              lzmin = -1.0;
              lzmax = 1.0;
          }
          else {
              lzmin *= 0.9;
              lzmax *= 1.1;
          }
      }

/* Report the overall graph mins and maxs. */
	if (autoscale_lx) {
		*x_min = (log_x ? pow(10.0, lxmin) : lxmin);
		*x_max = (log_x ? pow(10.0, lxmax) : lxmax);
	}
	else {
		*x_min = xmin;
		*x_max = xmax;
	}
	if (autoscale_ly) {
		*y_min = (log_y ? pow(10.0, lymin) : lymin);
		*y_max = (log_y ? pow(10.0, lymax) : lymax);
	}
	else {
		*y_min = ymin;
		*y_max = ymax;
	}
	if (autoscale_lz) {
		*z_min = (log_z ? pow(10.0, lzmin) : lzmin);
		*z_max = (log_z ? pow(10.0, lzmax) : lzmax);
	}
	else {
		*z_min = zmin;
		*z_max = zmax;
	}
}

#ifdef AMIGA_LC_5_1
void sleep(delay)
unsigned int delay;
{
  Delay(50 * delay);
}
#endif

#ifdef AMIGA_AC_5
void sleep(delay)
unsigned int delay;
{
unsigned long time_is_up;
	time_is_up = time(NULL) + (unsigned long) delay; 
	while (time(NULL)<time_is_up)
		/* wait */ ;
}
#endif

#ifdef MSDOS
#ifndef __TURBOC__	/* Turbo C already has sleep() */
#ifndef __ZTC__ 	/* ZTC already has usleep() */
/* kludge to provide sleep() for msc 5.1 */
void sleep(delay)
unsigned int delay;
{
unsigned long time_is_up;
	time_is_up = time(NULL) + (unsigned long) delay; 
	while (time(NULL)<time_is_up)
		/* wait */ ;
}
#endif /* not ZTC */
#endif /* not TURBOC */
#endif /* MSDOS */


/* Support for input, shell, and help for various systems */

#ifdef vms

#include <descrip.h>
#include <rmsdef.h>
#include <errno.h>
#include <smgdef.h>
#include <smgmsg.h>

extern lib$get_input(), lib$put_output();
extern smg$read_composed_line();

int vms_len;

unsigned int status[2] = {1, 0};

static char help[MAX_LINE_LEN+1] = "gnuplot";

$DESCRIPTOR(prompt_desc,PROMPT);
$DESCRIPTOR(line_desc,input_line);

$DESCRIPTOR(help_desc,help);
$DESCRIPTOR(helpfile_desc,"GNUPLOT$HELP");


read_line(prompt)
char *prompt;
{
    int more, start=0;
    char expand_prompt[40];

    prompt_desc.dsc$w_length = strlen (prompt);
    prompt_desc.dsc$a_pointer = prompt;
    (void) strcpy (expand_prompt, "_");
    (void) strncat (expand_prompt, prompt, 38);
    do {
        line_desc.dsc$w_length = MAX_LINE_LEN - start;
        line_desc.dsc$a_pointer = &input_line[start];
        switch(status[1] = smg$read_composed_line(&vms_vkid,0,&line_desc, &prompt_desc, &vms_len)){
		  case SMG$_EOF:
		  done(IO_SUCCESS);	/* ^Z isn't really an error */
		  break;
		  case RMS$_TNS:	/* didn't press return in time *
						   /
						   vms_len--; /* skip the last character */
		  break;			/* and parse anyway */
		  case RMS$_BES:	/* Bad Escape Sequence */
		  case RMS$_PES:	/* Partial Escape Sequence */
		  sys$putmsg(status);
		  vms_len = 0;		/* ignore the line */
		  break;
		  case SS$_NORMAL:
		  break;			/* everything's fine */
		  default:
		  done(status[1]);	/* give the error message */
        }
        start += vms_len;
        input_line[start] = '\0';
	   inline_num++;
        if (input_line[start-1] == '\\') {
		  /* Allow for a continuation line. */
		  prompt_desc.dsc$w_length = strlen (expand_prompt);
		  prompt_desc.dsc$a_pointer = expand_prompt;
		  more = 1;
		  --start;
        }
        else {
		  line_desc.dsc$w_length = strlen(input_line);
		  line_desc.dsc$a_pointer = input_line;
		  more = 0;
        }
    } while (more);
}


do_help()
{
	help_desc.dsc$w_length = strlen(help);
	if ((vaxc$errno = lbr$output_help(lib$put_output,0,&help_desc,
		&helpfile_desc,0,lib$get_input)) != SS$_NORMAL)
			os_error("can't open GNUPLOT$HELP",NO_CARET);
}


do_shell()
{
	if ((vaxc$errno = lib$spawn()) != SS$_NORMAL) {
		os_error("spawn error",NO_CARET);
	}
}


do_system()
{
	input_line[0] = ' ';	/* an embarrassment, but... */

	if ((vaxc$errno = lib$spawn(&line_desc)) != SS$_NORMAL)
		os_error("spawn error",NO_CARET);

	(void) putc('\n',stderr);
}

#else /* vms */

/* do_help: (not VMS, although it would work)
 * Give help to the user. 
 * It parses the command line into helpbuf and supplies help for that 
 * string. Then, if there are subtopics available for that key,
 * it prompts the user with this string. If more input is
 * given, do_help is called recursively, with the argument the index of 
 * null character in the string. Thus a more specific help can be 
 * supplied. This can be done repeatedly. 
 * If null input is given, the function returns, effecting a
 * backward climb up the tree.
 * David Kotz (David.Kotz@Dartmouth.edu) 10/89
 */
do_help()
{
    static char *helpbuf = NULL;
    static char *prompt = NULL;
    int base;				/* index of first char AFTER help string */
    int len;				/* length of current help string */
    BOOLEAN more_help;
    BOOLEAN only;			/* TRUE if only printing subtopics */
    int subtopics;			/* 0 if no subtopics for this topic */
    int start;				/* starting token of help string */
	char *help_ptr;			/* name of help file */

	if ( (help_ptr = getenv("GNUHELP")) == (char *)NULL )
		/* if can't find environment variable then just use HELPFILE */
		help_ptr = HELPFILE;

    /* Since MSDOS DGROUP segment is being overflowed we can not allow such  */
    /* huge static variables (1k each). Instead we dynamically allocate them */
    /* on the first call to this function...				     */
    if (helpbuf == NULL) {
	helpbuf = alloc(MAX_LINE_LEN, "help buffer");
	prompt = alloc(MAX_LINE_LEN, "help prompt");
	helpbuf[0] = prompt[0] = 0;
    }

    len = base = strlen(helpbuf);

    /* find the end of the help command */
    for (start = c_token; !(END_OF_COMMAND); c_token++)
	 ;
    /* copy new help input into helpbuf */
    if (len > 0)
	 helpbuf[len++] = ' ';	/* add a space */
    capture(helpbuf+len, start, c_token-1);
    squash_spaces(helpbuf+base); /* only bother with new stuff */
    lower_case(helpbuf+base); /* only bother with new stuff */
    len = strlen(helpbuf);

    /* now, a lone ? will print subtopics only */
    if (strcmp(helpbuf + (base ? base+1 : 0), "?") == 0) {
	   /* subtopics only */
	   subtopics = 1;
	   only = TRUE;
	   helpbuf[base] = '\0';	/* cut off question mark */
    } else {
	   /* normal help request */
	   subtopics = 0;
	   only = FALSE;
    }

    switch (help(helpbuf, help_ptr, &subtopics)) {
	   case H_FOUND: {
		  /* already printed the help info */
		  /* subtopics now is true if there were any subtopics */
		  screen_ok = FALSE;
    
		  do {
			 if (subtopics && !only) {
				/* prompt for subtopic with current help string */
				if (len > 0)
				  (void) sprintf(prompt, "Subtopic of %s: ", helpbuf);
				else
				  (void) strcpy(prompt, "Help topic: ");
				read_line(prompt);
				num_tokens = scanner(input_line);
				c_token = 0;
				more_help = !(END_OF_COMMAND);
				if (more_help)
				  /* base for next level is all of current helpbuf */
				  do_help();
			 } else 
			   more_help = FALSE;
		  } while(more_help);
    
		  break;
	   }
	   case H_NOTFOUND: {
		  printf("Sorry, no help for '%s'\n", helpbuf);
		  break;
	   }
	   case H_ERROR: {
		  perror(help_ptr);
		  break;
	   }
	   default: {		/* defensive programming */
		  int_error("Impossible case in switch\n", NO_CARET);
		  /* NOTREACHED */
	   }
    }
    
    helpbuf[base] = '\0';	/* cut it off where we started */
}

#ifdef AMIGA_AC_5
char strg0[256];
#endif

do_system()
{
#ifdef AMIGA_AC_5
   char *parms[80];
   void getparms();

   getparms(input_line+1,parms);
   if(fexecv(parms[0],parms) < 0)
#else
   if (system(input_line + 1))
#endif /* AMIGA_AC_5 */
      os_error("system() failed",NO_CARET);
}

#ifdef AMIGA_AC_5

/******************************************************************************/
/*                                                                            */
/*  Parses the command string (for fexecv use) and  converts the first token  */
/*     to lower case                                                          */
/*                                                                            */
/******************************************************************************/

void getparms(command,parms)
   char *command;
   char **parms;
   {
   register int i = 0;                         /* A bunch of indices          */
   register int j = 0;
   register int k = 0;

   while(*(command+j) != '\0')                 /* Loop on string characters   */
      {
      parms[k++] = strg0+i;
      while(*(command+j) == ' ') ++j;
      while(*(command+j) != ' ' && *(command+j) != '\0')
         {
         if(*(command+j) == '"')               /* Get quoted string           */
            for(*(strg0+(i++)) = *(command+(j++));
                *(command+j)  != '"';
                *(strg0+(i++)) = *(command+(j++)));
         *(strg0+(i++)) = *(command+(j++));
         }
      *(strg0+(i++)) = '\0';                   /* NUL terminate every token   */
      }
   parms[k] = '\0';

   for(k=strlen(strg0)-1; k>=0; --k)           /* Convert to lower case       */
      *(strg0+k)>='A' && *(strg0+k)<='Z'? *(strg0+k)|=32: *(strg0+k);
   }

#endif /* AMIGA_AC_5 */

#ifdef READLINE
char *
rlgets(s, n, prompt)
char *s;
int n;
char *prompt;
{
      char *readline();
      static char *line = (char *)NULL;

      /* If we already have a line, first free it */
      if(line != (char *)NULL) 
              free(line);

      line = readline((interactive)?prompt:"");

      /* If it's not an EOF */
      if(line) {
	  if (*line)
              add_history(line);
	  strncpy(s, line, n);
	  return s;
      }

      return line;
}
#endif /* READLINE */

#ifdef MSDOS

#ifdef __TURBOC__
/* cgets implemented using dos functions */
/* Maurice Castro 22/5/91 */
char *doscgets(s)
char *s;
{
   long datseg;

   /* protect and preserve segments - call dos to do the dirty work */
   datseg = _DS;

   _DX = FP_OFF(s);
   _DS = FP_SEG(s);
   _AH = 0x0A;
   geninterrupt(33);
   _DS = datseg;

   /* check for a carriage return and then clobber it with a null */
   if (s[s[1]+2] == '\r') 
      s[s[1]+2] = 0;

   /* return the input string */
   return(&(s[2]));
   }
#endif /* __TURBOC__ */


read_line(prompt)
	char *prompt;
{
    register int i;
    int start = 0, ilen = 0;
    BOOLEAN more;
    int last;
    char *p, *crnt_prompt = prompt;
    
#ifndef __ZTC__
	if (interactive) { /* if interactive use console IO so CED will work */
#ifndef READLINE
		cputs(prompt);
#endif /* READLINE */
		do {
		   ilen = MAX_LINE_LEN-start-1;
		   input_line[start] = ilen > 126 ? 126 : ilen;
#ifdef READLINE
		   input_line[start+2] = 0;
		   (void) rlgets(&(input_line[start+2]), ilen, crnt_prompt );
		   if (p = strchr(&(input_line[start+2]), '\r')) *p = 0;
		   if (p = strchr(&(input_line[start+2]), '\n')) *p = 0;
		   input_line[start+1] = strlen(&(input_line[start+2]));
#else /* READLINE */
#ifdef __TURBOC__
		   (void) doscgets(&(input_line[start]));
#else /* __TURBOC__ */
		   (void) cgets(&(input_line[start]));
#endif /* __TURBOC__ */
		   (void) putc('\n',stderr);
#endif /* READLINE */
		   if (input_line[start+2] == 26) {
			  /* end-of-file */
			  (void) putc('\n',stderr);
			  input_line[start] = '\0';
			  inline_num++;
			  if (start > 0)	/* don't quit yet - process what we have */
				more = FALSE;
			  else {
				 (void) putc('\n',stderr);
				 done(IO_SUCCESS);
				 /* NOTREACHED */
			  }
		   } else {
			  /* normal line input */
			  register i = start;
			  while ( (input_line[i] = input_line[i+2]) != (char)NULL )
				i++;		/* yuck!  move everything down two characters */

			  inline_num++;
			  last = strlen(input_line) - 1;
			  if (last + 1 >= MAX_LINE_LEN)
				int_error("Input line too long",NO_CARET);
					 
			  if (input_line[last] == '\\') { /* line continuation */
				 start = last;
				 more = TRUE;
			  } else
				more = FALSE;
		   }
#ifndef READLINE
		   if (more)
			cputs("> ");
#else
		   crnt_prompt = "> ";
#endif /* READLINE */
		} while(more);
	}
	else { /* not interactive */
#endif /* not ZTC */
		if (interactive)
		 fputs(prompt,stderr);
		do {
		   /* grab some input */
		   if ( fgets(&(input_line[start]), MAX_LINE_LEN - start, stdin) 
					== (char *)NULL ) {
			  /* end-of-file */
			  if (interactive)
				(void) putc('\n',stderr);
			  input_line[start] = '\0';
			  inline_num++;
			  if (start > 0)	/* don't quit yet - process what we have */
				more = FALSE;
			  else
				done(IO_SUCCESS); /* no return */
		   } else {
			  /* normal line input */
			  last = strlen(input_line) - 1;
			  if (input_line[last] == '\n') { /* remove any newline */
				 input_line[last] = '\0';
				 /* Watch out that we don't backup beyond 0 (1-1-1) */
				 if (last > 0) --last;
				 inline_num++;
			  } else if (last+1 >= MAX_LINE_LEN)
				int_error("Input line too long",NO_CARET);
					 
			  if (input_line[last] == '\\') { /* line continuation */
				 start = last;
				 more = TRUE;
			  } else
				more = FALSE;
		   }
			if (more && interactive)
			fputs("> ", stderr);
		} while(more);
#ifndef __ZTC__
	}
#endif
}


do_shell()
{
register char *comspec;
	if ((comspec = getenv("COMSPEC")) == (char *)NULL)
		comspec = "\command.com";
	if (spawnl(P_WAIT,comspec,NULL) == -1)
		os_error("unable to spawn shell",NO_CARET);
}

#else /* MSDOS */
		/* plain old Unix */

read_line(prompt)
	char *prompt;
{
    int start = 0;
    BOOLEAN more = FALSE;
    int last = 0;

#ifndef READLINE
    if (interactive)
	 fputs(prompt,stderr);
#endif /* READLINE */
    do {
	   /* grab some input */
#ifdef READLINE
	 if (((interactive)
		 ?rlgets(&(input_line[start]), MAX_LINE_LEN - start,
				((more)?"> ":prompt))
		 :fgets(&(input_line[start]), MAX_LINE_LEN - start, stdin))
                              == (char *)NULL ) {
#else
	   if ( fgets(&(input_line[start]), MAX_LINE_LEN - start, stdin) 
				== (char *)NULL ) {
#endif /* READLINE */
		  /* end-of-file */
		  if (interactive)
		    (void) putc('\n',stderr);
		  input_line[start] = '\0';
		  inline_num++;
		  if (start > 0)	/* don't quit yet - process what we have */
		    more = FALSE;
		  else
		    done(IO_SUCCESS); /* no return */
	   } else {
		  /* normal line input */
		  last = strlen(input_line) - 1;
		  if (input_line[last] == '\n') { /* remove any newline */
			 input_line[last] = '\0';
                /* Watch out that we don't backup beyond 0 (1-1-1) */
			 if (last > 0) --last;
			 inline_num++;
		  } else if (last+1 >= MAX_LINE_LEN)
		    int_error("Input line too long",NO_CARET);
				 
		  if (input_line[last] == '\\') { /* line continuation */
			 start = last;
			 more = TRUE;
		  } else
		    more = FALSE;
	   }
#ifndef READLINE
        if (more && interactive)
		fputs("> ", stderr);
#endif
    } while(more);
}

#ifdef VFORK

do_shell()
{
register char *shell;
register int p;
static int execstat;
	if (!(shell = getenv("SHELL")))
		shell = SHELL;
#ifdef AMIGA_AC_5
	execstat = fexecl(shell,shell,NULL);
#else
	if ((p = vfork()) == 0) {
		execstat = execl(shell,shell,NULL);
		_exit(1);
	} else if (p == -1)
		os_error("vfork failed",c_token);
	else
		while (wait(NULL) != p)
#endif
			;
	if (execstat == -1)
		os_error("shell exec failed",c_token);
	(void) putc('\n',stderr);
}
#else /* VFORK */

#ifdef AMIGA_LC_5_1
do_shell()
{
register char *shell;
	if (!(shell = getenv("SHELL")))
		shell = SHELL;

	if (system(shell))
		os_error("system() failed",NO_CARET);

	(void) putc('\n',stderr);
}
#else /* AMIGA_LC_5_1 */

#define EXEC "exec "
do_shell()
{
static char exec[100] = EXEC;
register char *shell;
	if (!(shell = getenv("SHELL")))
		shell = SHELL;

	if (system(strncpy(&exec[sizeof(EXEC)-1],shell,
		sizeof(exec)-sizeof(EXEC)-1)))
		os_error("system() failed",NO_CARET);

	(void) putc('\n',stderr);
}
#endif /* AMIGA_LC_5_1 */
#endif /* VFORK */
#endif /* MSDOS */
#endif /* vms */
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/contour.c version [702d747f5e].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
#ifndef lint
static char *RCSid = "$Id: contour.c,v 3.26 92/03/24 22:35:54 woo Exp Locker: woo $";
#endif

/* GNUPLOT - contour.c */
/*
 * Copyright (C) 1986, 1987, 1990, 1991, 1992   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 * 
 *   Original Software:
 *       Gershon Elber
 * 
 * Send your comments or suggestions to 
 *  info-gnuplot@ames.arc.nasa.gov.
 * This is a mailing list; to join it send a note to 
 *  info-gnuplot-request@ames.arc.nasa.gov.  
 * Send bug reports to
 *  bug-gnuplot@ames.arc.nasa.gov.
 */

#include <stdio.h>
#include "plot.h"

#define DEFAULT_NUM_OF_ZLEVELS  10  /* Some dflt values (setable via flags). */
#define DEFAULT_NUM_APPROX_PTS  5
#define DEFAULT_BSPLINE_ORDER  3
#define MAX_NUM_OF_ZLEVELS      100 /* Some max. values (setable via flags). */
#define MAX_NUM_APPROX_PTS      100
#define MAX_BSPLINE_ORDER      10

#define INTERP_NOTHING   0            /* Kind of interpolations on contours. */
#define INTERP_CUBIC     1                           /* Cubic spline interp. */
#define APPROX_BSPLINE   2                         /* Bspline interpolation. */

#define ACTIVE   1                    /* Status of edges at certain Z level. */
#define INACTIVE 2

#define OPEN_CONTOUR     1                                 /* Contour kinds. */
#define CLOSED_CONTOUR   2

#define EPSILON  1e-5              /* Used to decide if two float are equal. */
#define INFINITY 1e10

#ifndef TRUE
#define TRUE     -1
#define FALSE    0
#endif

#define DEFAULT_NUM_CONTOURS	10
#define MAX_POINTS_PER_CNTR 	100
#define SHIFT_Z_EPSILON		0.000301060 /* Dec. change of poly bndry hit.*/

#define abs(x)  ((x) > 0 ? (x) : (-(x)))
#define sqr(x)  ((x) * (x))

#ifndef AMIGA_AC_5
extern double sqrt();
#endif /* not AMIGA_AC_5 */
typedef double tri_diag[3];         /* Used to allocate the tri-diag matrix. */
typedef double table_entry[4];	       /* Cubic spline interpolation 4 coef. */

struct vrtx_struct {
    double X, Y, Z;                       /* The coordinates of this vertex. */
    struct vrtx_struct *next;                             /* To chain lists. */
};

struct edge_struct {
    struct poly_struct *poly[2];   /* Each edge belongs to up to 2 polygons. */
    struct vrtx_struct *vertex[2]; /* The two extreme points of this vertex. */
    struct edge_struct *next;                             /* To chain lists. */
    int status, /* Status flag to mark edges in scanning at certain Z level. */
	boundary;                   /* True if this edge is on the boundary. */
};

struct poly_struct {
    struct edge_struct *edge[3];           /* As we do triangolation here... */
    struct poly_struct *next;                             /* To chain lists. */
};

struct cntr_struct {	       /* Contours are saved using this struct list. */
    double X, Y;                          /* The coordinates of this vertex. */
    struct cntr_struct *next;                             /* To chain lists. */
};

static int test_boundary;    /* If TRUE look for contours on boundary first. */
static struct gnuplot_contours *contour_list = NULL;
static double crnt_cntr[MAX_POINTS_PER_CNTR * 2];
static int crnt_cntr_pt_index = 0;
static double contour_level = 0.0;
static table_entry *hermit_table = NULL;    /* Hold hermite table constants. */
static int num_of_z_levels = DEFAULT_NUM_OF_ZLEVELS;  /* # Z contour levels. */
static int num_approx_pts = DEFAULT_NUM_APPROX_PTS;/* # pts per approx/inter.*/
static int bspline_order = DEFAULT_BSPLINE_ORDER;   /* Bspline order to use. */
static int interp_kind = INTERP_NOTHING;  /* Linear, Cubic interp., Bspline. */

static void gen_contours();
static int update_all_edges();
static struct cntr_struct *gen_one_contour();
static struct cntr_struct *trace_contour();
static struct cntr_struct *update_cntr_pt();
static int fuzzy_equal();
static void gen_triangle();
static struct vrtx_struct *gen_vertices();
static struct edge_struct *gen_edges_middle();
static struct edge_struct *gen_edges();
static struct poly_struct *gen_polys();
static void free_contour();
static void put_contour();
static put_contour_nothing();
static put_contour_cubic();
static put_contour_bspline();
static calc_tangent();
static int count_contour();
static complete_spline_interp();
static calc_hermit_table();
static hermit_interp();
static prepare_spline_interp();
static int solve_tri_diag();
static gen_bspline_approx();
static double fetch_knot();
static eval_bspline();

/*
 * Entry routine to this whole set of contouring module.
 */
struct gnuplot_contours *contour(num_isolines, iso_lines,
				 ZLevels, approx_pts, kind, order1)
int num_isolines;
struct iso_curve *iso_lines;
int ZLevels, approx_pts, kind, order1;
{
    int i;
    struct poly_struct *p_polys, *p_poly;
    struct edge_struct *p_edges, *p_edge;
    struct vrtx_struct *p_vrts, *p_vrtx;
    double x_min, y_min, z_min, x_max, y_max, z_max, z, dz, z_scale = 1.0;

    num_of_z_levels = ZLevels;
    num_approx_pts = approx_pts;
    bspline_order = order1 - 1;
    interp_kind = kind;

    contour_list = NULL;

    if (interp_kind == INTERP_CUBIC) calc_hermit_table();

    gen_triangle(num_isolines, iso_lines, &p_polys, &p_edges, &p_vrts,
		&x_min, &y_min, &z_min, &x_max, &y_max, &z_max);
    dz = (z_max - z_min) / (num_of_z_levels+1);
    /* Step from z_min+dz upto z_max-dz in num_of_z_levels times. */
    z = z_min + dz;
    crnt_cntr_pt_index = 0;

    for (i=0; i<num_of_z_levels; i++, z += dz) {
	contour_level = z;
	gen_contours(p_edges, z + dz * SHIFT_Z_EPSILON, x_min, x_max,
							y_min, y_max);
    }

    /* Free all contouring related temporary data. */
    while (p_polys) {
	p_poly = p_polys -> next;
	free (p_polys);
	p_polys = p_poly;
    }
    while (p_edges) {
	p_edge = p_edges -> next;
	free (p_edges);
	p_edges = p_edge;
    }
    while (p_vrts) {
	p_vrtx = p_vrts -> next;
	free (p_vrts);
	p_vrts = p_vrtx;
    }

    if (interp_kind == INTERP_CUBIC) free(hermit_table);

    return contour_list;
}

/*
 * Adds another point to the currently build contour.
 */
add_cntr_point(x, y)
double x, y;
{
    int index;

    if (crnt_cntr_pt_index >= MAX_POINTS_PER_CNTR-1) {
	index = crnt_cntr_pt_index - 1;
	end_crnt_cntr();
	crnt_cntr[0] = crnt_cntr[index * 2];
	crnt_cntr[1] = crnt_cntr[index * 2 + 1];
	crnt_cntr_pt_index = 1; /* Keep the last point as first of this one. */
    }
    crnt_cntr[crnt_cntr_pt_index * 2] = x;
    crnt_cntr[crnt_cntr_pt_index * 2 + 1] = y;
    crnt_cntr_pt_index++;
}

/*
 * Done with current contour - create gnuplot data structure for it.
 */
end_crnt_cntr()
{
    int i;
    struct gnuplot_contours *cntr = (struct gnuplot_contours *)
					alloc(sizeof(struct gnuplot_contours),
					      "gnuplot_contour");

    cntr->coords = (struct coordinate *) alloc(sizeof(struct coordinate) *
							  crnt_cntr_pt_index,
					       "contour coords");
    for (i=0; i<crnt_cntr_pt_index; i++) {
	cntr->coords[i].x = crnt_cntr[i * 2];
	cntr->coords[i].y = crnt_cntr[i * 2 + 1];
	cntr->coords[i].z = contour_level;
    }
    cntr->num_pts = crnt_cntr_pt_index;

    cntr->next = contour_list;
    contour_list = cntr;

    crnt_cntr_pt_index = 0;
}

/*
 * Generates all contours by tracing the intersecting triangles.
 */
static void gen_contours(p_edges, z_level, x_min, x_max, y_min, y_max)
struct edge_struct *p_edges;
double z_level, x_min, x_max, y_min, y_max;
{
    int num_active,                        /* Number of edges marked ACTIVE. */
	contour_kind;                /* One of OPEN_CONTOUR, CLOSED_CONTOUR. */
    struct cntr_struct *p_cntr;

    num_active = update_all_edges(p_edges, z_level);           /* Do pass 1. */

    test_boundary = TRUE;        /* Start to look for contour on boundaries. */

    while (num_active > 0) {                                   /* Do Pass 2. */
        /* Generate One contour (and update MumActive as needed): */
	p_cntr = gen_one_contour(p_edges, z_level, &contour_kind, &num_active);
	put_contour(p_cntr, z_level, x_min, x_max, y_min, y_max,
			      contour_kind); /* Emit it in requested format. */
    }
}

/*
 * Does pass 1, or marks the edges which are active (crosses this z_level)
 * as ACTIVE, and the others as INACTIVE:
 * Returns number of active edges (marked ACTIVE).
 */
static int update_all_edges(p_edges, z_level)
struct edge_struct *p_edges;
double z_level;
{
    int count = 0;

    while (p_edges) {
	if (((p_edges -> vertex[0] -> Z >= z_level) &&
	     (p_edges -> vertex[1] -> Z <= z_level)) ||
	    ((p_edges -> vertex[1] -> Z >= z_level) &&
	     (p_edges -> vertex[0] -> Z <= z_level))) {
	    p_edges -> status = ACTIVE;
	    count++;
	}
	else p_edges -> status = INACTIVE;
	p_edges = p_edges -> next;
    }

    return count;
}

/*
 * Does pass 2, or find one complete contour out of the triangolation data base:
 * Returns a pointer to the contour (as linked list), contour_kind is set to
 * one of OPEN_CONTOUR, CLOSED_CONTOUR, and num_active is updated.
 */
static struct cntr_struct *gen_one_contour(p_edges, z_level, contour_kind,
								num_active)
struct edge_struct *p_edges;
double z_level;
int *contour_kind, *num_active;
{
    struct edge_struct *pe_temp;

    if (test_boundary) {    /* Look for something to start with on boundary: */
	pe_temp = p_edges;
	while (pe_temp) {
	    if ((pe_temp -> status == ACTIVE) && (pe_temp -> boundary)) break;
	    pe_temp = pe_temp -> next;
	}
	if (!pe_temp) test_boundary = FALSE;/* No more contours on boundary. */
	else {
	    *contour_kind = OPEN_CONTOUR;
	    return trace_contour(pe_temp, z_level, num_active, *contour_kind);
	}
    }

    if (!test_boundary) {        /* Look for something to start with inside: */
	pe_temp = p_edges;
	while (pe_temp) {
	    if ((pe_temp -> status == ACTIVE) && (!(pe_temp -> boundary)))
		break;
	    pe_temp = pe_temp -> next;
	}
	if (!pe_temp) {
	    *num_active = 0;
	    return NULL;
	}
	else {
	    *contour_kind = CLOSED_CONTOUR;
	    return trace_contour(pe_temp, z_level, num_active, *contour_kind);
	}
    }
    return NULL;		     /* We should never be here, but lint... */
}

/*
 * Search the data base along a contour starts at the edge pe_start until
 * a boundary edge is detected or until we close the loop back to pe_start.
 * Returns a linked list of all the points on the contour
 * Also decreases num_active by the number of points on contour.
 */
static struct cntr_struct *trace_contour(pe_start, z_level, num_active,
								contour_kind)
struct edge_struct *pe_start;
double z_level;
int *num_active, contour_kind;
{
    int i, in_middle;       /* If TRUE the z_level is in the middle of edge. */
    struct cntr_struct *p_cntr, *pc_tail;
    struct edge_struct *p_edge = pe_start, *p_next_edge;
    struct poly_struct *p_poly, *PLastpoly = NULL;

    /* Generate the header of the contour - the point on pe_start. */
    if (contour_kind == OPEN_CONTOUR) pe_start -> status = INACTIVE;
    (*num_active)--;
    p_cntr = pc_tail = update_cntr_pt(pe_start, z_level, &in_middle);
    if (!in_middle) {
	return NULL;
    }

    do {
	/* Find polygon to continue (Not where we came from - PLastpoly): */
	if (p_edge -> poly[0] == PLastpoly) p_poly = p_edge -> poly[1];
	else p_poly = p_edge -> poly[0];
	p_next_edge = NULL;		  /* In case of error, remains NULL. */
	for (i=0; i<3; i++)              /* Test the 3 edges of the polygon: */
	    if (p_poly -> edge[i] != p_edge)
	        if (p_poly -> edge[i] -> status == ACTIVE)
		    p_next_edge = p_poly -> edge[i];
	if (!p_next_edge) {
	    pc_tail -> next = NULL;
	    free_contour(p_cntr);
	    return NULL;
	}
	p_edge = p_next_edge;
	PLastpoly = p_poly;
	p_edge -> status = INACTIVE;
	(*num_active)--;
	pc_tail -> next = update_cntr_pt(p_edge, z_level, &in_middle);
	if (!in_middle) {
	    pc_tail -> next = NULL;
	    free_contour(p_cntr);
	    return NULL;
	}
        pc_tail = pc_tail -> next;
    }
    while ((pe_start != p_edge) && (!p_edge -> boundary));
    pc_tail -> next = NULL;

    return p_cntr;
}

/*
 * Allocates one contour location and update it to to correct position
 * according to z_level and edge p_edge. if z_level is found to be at
 * one of the extreme points nothing is allocated (NULL is returned)
 * and in_middle is set to FALSE.
 */
static struct cntr_struct *update_cntr_pt(p_edge, z_level, in_middle)
struct edge_struct *p_edge;
double z_level;
int *in_middle;
{
    double t;
    struct cntr_struct *p_cntr;

    t = (z_level - p_edge -> vertex[0] -> Z) /
	(p_edge -> vertex[1] -> Z - p_edge -> vertex[0] -> Z);

    if (fuzzy_equal(t, 1.0) || fuzzy_equal(t, 0.0)) {
        *in_middle = FALSE;
        return NULL;
    }
    else {
	*in_middle = TRUE;
	p_cntr = (struct cntr_struct *) alloc(sizeof(struct cntr_struct),
							"contour cntr_struct");
	p_cntr -> X = p_edge -> vertex[1] -> X * t +
		     p_edge -> vertex[0] -> X * (1-t);
	p_cntr -> Y = p_edge -> vertex[1] -> Y * t +
		     p_edge -> vertex[0] -> Y * (1-t);
	return p_cntr;
    }
}

/*
 * Simple routine to decide if two real values are equal by simply
 * calculating the relative/absolute error between them (< EPSILON).
 */
static int fuzzy_equal(x, y)
double x, y;
{
    if (abs(x) > EPSILON)			/* Calculate relative error: */
        return (abs((x - y) / x) < EPSILON);
    else					/* Calculate absolute error: */
	return (abs(x - y) < EPSILON);
}

/*
 * Generate the triangles.
 * Returns the lists (vrtxs edges & polys) via pointers to their heads.
 */
static void gen_triangle(num_isolines, iso_lines, p_polys, p_edges,
	p_vrts, x_min, y_min, z_min, x_max, y_max, z_max)
int num_isolines;
struct iso_curve *iso_lines;
struct poly_struct **p_polys;
struct edge_struct **p_edges;
struct vrtx_struct **p_vrts;
double *x_min, *y_min, *z_min, *x_max, *y_max, *z_max;
{
    int i, grid_x_max = iso_lines->p_count;
    struct vrtx_struct *p_vrtx1, *p_vrtx2, *pv_temp;
    struct edge_struct *p_edge1, *p_edge2, *pe_tail1, *pe_tail2, *pe_temp,
		      *p_edge_middle, *pe_m_tail;
    struct poly_struct *p_poly, *pp_tail;

    *p_polys = NULL;
    *p_edges = NULL;
    *p_vrts = NULL;
    *z_min = INFINITY;
    *y_min = INFINITY;
    *x_min = INFINITY;
    *z_max = -INFINITY;
    *y_max = -INFINITY;
    *x_max = -INFINITY;

    /* Read 1st row. */
    p_vrtx1 = gen_vertices(grid_x_max, iso_lines->points,
			   x_min, y_min, z_min, x_max, y_max, z_max);
    *p_vrts = p_vrtx1;
    /* Gen. its edges.*/
    pe_temp = p_edge1 = gen_edges(grid_x_max, p_vrtx1, &pe_tail1);
    for (i = 1; i < grid_x_max; i++) {/* Mark one side of edges as boundary. */
	pe_temp -> poly[1] = NULL;
	pe_temp = pe_temp -> next;
    }
    for (i = 1; i < num_isolines; i++) { /* Read next column and gen. polys. */
	iso_lines = iso_lines->next;
    	/* Get row into list. */
        p_vrtx2 = gen_vertices(grid_x_max, iso_lines->points,
			       x_min, y_min, z_min, x_max, y_max, z_max);
    	/* Generate its edges. */
        p_edge2 = gen_edges(grid_x_max, p_vrtx2, &pe_tail2);
	/* Generate edges from one vertex list to the other one: */
	p_edge_middle = gen_edges_middle(grid_x_max, p_vrtx1, p_vrtx2,
								 &pe_m_tail);

	/* Now we can generate the polygons themselves (triangles). */
	p_poly = gen_polys(grid_x_max, p_edge1, p_edge_middle, p_edge2,
								 &pp_tail);
        pe_tail1 -> next = (*p_edges);      /* Chain new edges to main list. */
        pe_m_tail -> next = p_edge1;
	*p_edges = p_edge_middle;
	pe_tail1 = pe_tail2;
	p_edge1 = p_edge2;

	pv_temp = p_vrtx2;
	while (pv_temp -> next) pv_temp = pv_temp -> next;
	pv_temp -> next = *p_vrts;
	*p_vrts = p_vrtx1 = p_vrtx2;

        pp_tail -> next = (*p_polys);       /* Chain new polys to main list. */
	*p_polys = p_poly;
    }

    pe_temp = p_edge1;
    for (i = 1; i < grid_x_max; i++) {/* Mark one side of edges as boundary. */
	pe_temp -> poly[0] = NULL;
	pe_temp = pe_temp -> next;
    }

    pe_tail1 -> next = (*p_edges);    /* Chain last edges list to main list. */
    *p_edges = p_edge1;

    /* Update the boundary flag, saved in each edge, and update indexes: */
    pe_temp = (*p_edges);
    i = 1;

    while (pe_temp) {
	pe_temp -> boundary = (!(pe_temp -> poly[0])) ||
			      (!(pe_temp -> poly[1]));
	pe_temp = pe_temp -> next;
    }
}

/*
 * Handles grid_x_max 3D points (One row) and generate linked list for them.
 */
static struct vrtx_struct *gen_vertices(grid_x_max, points,
				      x_min, y_min, z_min, x_max, y_max, z_max)
int grid_x_max;
struct coordinate *points;
double *x_min, *y_min, *z_min, *x_max, *y_max, *z_max;
{
    int i;
    struct vrtx_struct *p_vrtx, *pv_tail, *pv_temp;

    for (i=0; i<grid_x_max; i++) {/* Get a point and generate the structure. */
        pv_temp = (struct vrtx_struct *) alloc(sizeof(struct vrtx_struct),
						"contour vertex");
	pv_temp -> X = points[i].x;
	pv_temp -> Y = points[i].y;
	pv_temp -> Z = points[i].z;

	if (pv_temp -> X > *x_max) *x_max = pv_temp -> X; /* Update min/max. */
	if (pv_temp -> Y > *y_max) *y_max = pv_temp -> Y;
	if (pv_temp -> Z > *z_max) *z_max = pv_temp -> Z;
	if (pv_temp -> X < *x_min) *x_min = pv_temp -> X;
	if (pv_temp -> Y < *y_min) *y_min = pv_temp -> Y;
	if (pv_temp -> Z < *z_min) *z_min = pv_temp -> Z;

	if (i == 0)                              /* First vertex in row: */
	    p_vrtx = pv_tail = pv_temp;
	else {
	    pv_tail -> next = pv_temp;   /* Stick new record as last one. */
	    pv_tail = pv_tail -> next;    /* And continue to last record. */
	}
    }
    pv_tail -> next = NULL;

    return p_vrtx;
}

/*
 * Combines N vertices in pair to form N-1 edges.
 * Returns pointer to the edge list (pe_tail will point on last edge in list).
 */
static struct edge_struct *gen_edges(grid_x_max, p_vrtx, pe_tail)
int grid_x_max;
struct vrtx_struct *p_vrtx;
struct edge_struct **pe_tail;
{
    int i;
    struct edge_struct *p_edge, *pe_temp;

    for (i=0; i<grid_x_max-1; i++) {         /* Generate grid_x_max-1 edges: */
	pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
						"contour edge");
	pe_temp -> vertex[0] = p_vrtx;              /* First vertex of edge. */
	p_vrtx = p_vrtx -> next;                     /* Skip to next vertex. */
	pe_temp -> vertex[1] = p_vrtx;             /* Second vertex of edge. */
        if (i == 0)                                    /* First edge in row: */
	    p_edge = (*pe_tail) = pe_temp;
	else {
	    (*pe_tail) -> next = pe_temp;   /* Stick new record as last one. */
	    *pe_tail = (*pe_tail) -> next;   /* And continue to last record. */
 	}
    }
    (*pe_tail) -> next = NULL;

    return p_edge;
}

/*
 * Combines 2 lists of N vertices each into edge list:
 * The dots (.) are the vertices list, and the              .  .  .  .
 *  edges generated are alternations of vertical edges      |\ |\ |\ |
 *  (|) and diagonal ones (\).                              | \| \| \|
 *  A pointer to edge list (alternate | , \) is returned    .  .  .  .
 * Note this list will have (2*grid_x_max-1) edges (pe_tail points on last
 * record).
 */
static struct edge_struct *gen_edges_middle(grid_x_max, p_vrtx1, p_vrtx2,
								pe_tail)
int grid_x_max;
struct vrtx_struct *p_vrtx1, *p_vrtx2;
struct edge_struct **pe_tail;
{
    int i;
    struct edge_struct *p_edge, *pe_temp;

    /* Gen first (|). */
    pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
							"contour edge");
    pe_temp -> vertex[0] = p_vrtx2;                 /* First vertex of edge. */
    pe_temp -> vertex[1] = p_vrtx1;                /* Second vertex of edge. */
    p_edge = (*pe_tail) = pe_temp;

    /* Advance in vrtx list grid_x_max-1 times, and gen. 2 edges /| for each.*/
    for (i=0; i<grid_x_max-1; i++) {
	/* The / edge. */
	pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
							"contour edge");
	pe_temp -> vertex[0] = p_vrtx1;             /* First vertex of edge. */
	pe_temp -> vertex[1] = p_vrtx2 -> next;    /* Second vertex of edge. */
        (*pe_tail) -> next = pe_temp;       /* Stick new record as last one. */
	*pe_tail = (*pe_tail) -> next;       /* And continue to last record. */

	/* The | edge. */
	pe_temp = (struct edge_struct *) alloc(sizeof(struct edge_struct),
							"contour edge");
	pe_temp -> vertex[0] = p_vrtx2 -> next;     /* First vertex of edge. */
	pe_temp -> vertex[1] = p_vrtx1 -> next;    /* Second vertex of edge. */
        (*pe_tail) -> next = pe_temp;       /* Stick new record as last one. */
	*pe_tail = (*pe_tail) -> next;       /* And continue to last record. */

        p_vrtx1 = p_vrtx1 -> next;   /* Skip to next vertices in both lists. */
        p_vrtx2 = p_vrtx2 -> next;
    }
    (*pe_tail) -> next = NULL;

    return p_edge;
}

/*
 * Combines 3 lists of edges into triangles:
 * 1. p_edge1: Top horizontal edge list:        -----------------------
 * 2. p_edge_middge: middle edge list:         |\  |\  |\  |\  |\  |\  |
 *                                             |  \|  \|  \|  \|  \|  \|
 * 3. p_edge2: Bottom horizontal edge list:     -----------------------
 * Note that p_edge1/2 lists has grid_x_max-1 edges, while p_edge_middle has
 * (2*grid_x_max-1) edges.
 * The routine simple scans the two list    Upper 1         Lower
 * and generate two triangle upper one        ----         | \
 * and lower one from the lists:             0\   |2      0|   \1
 * (Nums. are edges order in polys)             \ |         ----
 * The routine returns a pointer to a                         2
 * polygon list (pp_tail points on last polygon).          1
 *                                                   -----------
 * In addition, the edge lists are updated -        | \   0     |
 * each edge has two pointers on the two            |   \       |
 * (one active if boundary) polygons which         0|1   0\1   0|1
 * uses it. These two pointer to polygons           |       \   |
 * are named: poly[0], poly[1]. The diagram         |    1    \ |
 * on the right show how they are used for the       -----------
 * upper and lower polygons.                             0
 */
static struct poly_struct *gen_polys(grid_x_max, p_edge1, p_edge_middle,
							p_edge2, pp_tail)
int grid_x_max;
struct edge_struct *p_edge1, *p_edge_middle, *p_edge2;
struct poly_struct **pp_tail;
{
    int i;
    struct poly_struct *p_poly, *pp_temp;

    p_edge_middle -> poly[0] = NULL;			    /* Its boundary! */

    /* Advance in vrtx list grid_x_max-1 times, and gen. 2 polys for each. */
    for (i=0; i<grid_x_max-1; i++) {
	/* The Upper. */
	pp_temp = (struct poly_struct *) alloc(sizeof(struct poly_struct),
							"contour poly");
	/* Now update polys about its edges, and edges about the polygon. */
	pp_temp -> edge[0] = p_edge_middle -> next;
	p_edge_middle -> next -> poly[1] = pp_temp;
	pp_temp -> edge[1] = p_edge1;
	p_edge1 -> poly[0] = pp_temp;
	pp_temp -> edge[2] = p_edge_middle -> next -> next;
	p_edge_middle -> next -> next -> poly[0] = pp_temp;
	if (i == 0)				   /* Its first one in list: */
	    p_poly = (*pp_tail) = pp_temp;
	else {
	    (*pp_tail) -> next = pp_temp;
	    *pp_tail = (*pp_tail) -> next;
	}

	/* The Lower. */
	pp_temp = (struct poly_struct *) alloc(sizeof(struct poly_struct),
							"contour poly");
	/* Now update polys about its edges, and edges about the polygon. */
	pp_temp -> edge[0] = p_edge_middle;
	p_edge_middle -> poly[1] = pp_temp;
	pp_temp -> edge[1] = p_edge_middle -> next;
	p_edge_middle -> next -> poly[0] = pp_temp;
	pp_temp -> edge[2] = p_edge2;
	p_edge2 -> poly[1] = pp_temp;
	(*pp_tail) -> next = pp_temp;
	*pp_tail = (*pp_tail) -> next;

        p_edge1 = p_edge1 -> next;
        p_edge2 = p_edge2 -> next;
        p_edge_middle = p_edge_middle -> next -> next;
    }
    p_edge_middle -> poly[1] = NULL;			    /* Its boundary! */
    (*pp_tail) -> next = NULL;

    return p_poly;
}

/*
 * Calls the (hopefully) desired interpolation/approximation routine.
 */
static void put_contour(p_cntr, z_level, x_min, x_max, y_min, y_max, contr_kind)
struct cntr_struct *p_cntr;
double z_level, x_min, x_max, y_min, y_max;
int contr_kind;
{
    if (!p_cntr) return;            /* Nothing to do if it is empty contour. */

    switch (interp_kind) {
	case INTERP_NOTHING:              /* No interpolation/approximation. */
	    put_contour_nothing(p_cntr);
	    break;
	case INTERP_CUBIC:                    /* Cubic spline interpolation. */
	    put_contour_cubic(p_cntr, z_level, x_min, x_max, y_min, y_max,
								contr_kind);
	    break;
	case APPROX_BSPLINE:                       /* Bspline approximation. */
	    put_contour_bspline(p_cntr, z_level, x_min, x_max, y_min, y_max,
    								contr_kind);
	    break;
    }

    free_contour(p_cntr);
}

/*
 * Simply puts contour coordinates in order with no interpolation or
 * approximation.
 */
static put_contour_nothing(p_cntr)
struct cntr_struct *p_cntr;
{
    while (p_cntr) {
	add_cntr_point(p_cntr -> X, p_cntr -> Y);
	p_cntr = p_cntr -> next;
    }
    end_crnt_cntr();
}

/*
 * Find Complete Cubic Spline Interpolation.
 */
static put_contour_cubic(p_cntr, z_level, x_min, x_max, y_min, y_max,
								 contr_kind)
struct cntr_struct *p_cntr;
double z_level, x_min, x_max, y_min, y_max;
int contr_kind;
{
    int num_pts, i;
    double tx1, ty1, tx2, ty2;                    /* Tangents at end points. */
    struct cntr_struct *pc_temp;

    num_pts = count_contour(p_cntr);         /* Number of points in contour. */

    if (num_pts > 2) {  /* Take into account 3 points in tangent estimation. */
	calc_tangent(3, p_cntr -> X, p_cntr -> next -> X,
			p_cntr -> next -> next -> X,
			p_cntr -> Y, p_cntr -> next -> Y,
			p_cntr -> next -> next -> Y, &tx1, &ty1);
	pc_temp = p_cntr;
	for (i=3; i<num_pts; i++) pc_temp = pc_temp -> next;/* Go to the end.*/
	calc_tangent(3, pc_temp -> next -> next -> X,
 			pc_temp -> next -> X, pc_temp -> X,
			pc_temp -> next -> next -> Y,
			pc_temp -> next -> Y, pc_temp -> Y, &tx2, &ty2);
        tx2 = (-tx2);   /* Inverse the vector as we need opposite direction. */
        ty2 = (-ty2);
    }
    /* If following (num_pts > 1) is TRUE then exactly 2 points in contour.  */
    else if (num_pts > 1) {/* Take into account 2 points in tangent estimat. */
	calc_tangent(2, p_cntr -> X, p_cntr -> next -> X, 0.0,
			p_cntr -> Y, p_cntr -> next -> Y, 0.0, &tx1, &ty1);
	calc_tangent(2, p_cntr -> next -> X, p_cntr -> X, 0.0,
			p_cntr -> next -> Y, p_cntr -> Y, 0.0, &tx2, &ty2);
        tx2 = (-tx2);   /* Inverse the vector as we need opposite direction. */
        ty2 = (-ty2);
    }
    else return;			/* Only one point (???) - ignore it. */

    switch (contr_kind) {
	case OPEN_CONTOUR:
	    break;
	case CLOSED_CONTOUR:
	    tx1 = tx2 = (tx1 + tx2) / 2.0;	     /* Make tangents equal. */
	    ty1 = ty2 = (ty1 + ty2) / 2.0;
	    break;
    }
    complete_spline_interp(p_cntr, num_pts, 0.0, 1.0, tx1, ty1, tx2, ty2);
    end_crnt_cntr();
}

/*
 * Find Bspline approximation for this data set.
 * Uses global variable num_approx_pts to determine number of samples per
 * interval, where the knot vector intervals are assumed to be uniform, and
 * Global variable bspline_order for the order of Bspline to use.
 */
static put_contour_bspline(p_cntr, z_level, x_min, x_max, y_min, y_max,
								contr_kind)
struct cntr_struct *p_cntr;
double z_level, x_min, x_max,  y_min, y_max;
int contr_kind;
{
    int num_pts, i, order = bspline_order;
    struct cntr_struct *pc_temp;

    num_pts = count_contour(p_cntr);         /* Number of points in contour. */
    if (num_pts < 2) return;     /* Cannt do nothing if empty or one points! */
    /* Order must be less than number of points in curve - fix it if needed. */
    if (order > num_pts - 1) order = num_pts - 1;

    gen_bspline_approx(p_cntr, num_pts, order, contr_kind);
    end_crnt_cntr();
}

/*
 * Estimate the tangents according to the n last points where n might be
 * 2 or 3 (if 2 onlt x1, x2).
 */
static calc_tangent(n, x1, x2, x3, y1, y2, y3, tx, ty)
int n;
double x1, x2, x3, y1, y2, y3, *tx, *ty;
{
    double v1[2], v2[2], v1_magnitude, v2_magnitude;

    switch (n) {
	case 2:
	    *tx = (x2 - x1) * 0.3;
	    *ty = (y2 - y1) * 0.3;
	    break;
	case 3:
	    v1[0] = x2 - x1;   v1[1] = y2 - y1;
	    v2[0] = x3 - x2;   v2[1] = y3 - y2;
	    v1_magnitude = sqrt(sqr(v1[0]) + sqr(v1[1]));
	    v2_magnitude = sqrt(sqr(v2[0]) + sqr(v2[1]));
	    *tx = (v1[0] / v1_magnitude) - (v2[0] / v2_magnitude) * 0.1;
	    *tx *= v1_magnitude * 0.1;  /* Make tangent less than magnitude. */
	    *ty = (v1[1] / v1_magnitude) - (v2[1] / v2_magnitude) * 0.1;
	    *ty *= v1_magnitude * 0.1;  /* Make tangent less than magnitude. */
	    break;
	default:				       /* Should not happen! */
	    (*ty) = 0.1;
	    *tx = 0.1;
	    break;
    }
}

/*
 * Free all elements in the contour list.
 */
static void free_contour(p_cntr)
struct cntr_struct *p_cntr;
{
    struct cntr_struct *pc_temp;

    while (p_cntr) {
	pc_temp = p_cntr;
	p_cntr = p_cntr -> next;
	free((char *) pc_temp);
    }
}

/*
 * Counts number of points in contour.
 */
static int count_contour(p_cntr)
struct cntr_struct *p_cntr;
{
    int count = 0;

    while (p_cntr) {
	count++;
	p_cntr = p_cntr -> next;
    }
    return count;
}

/*
 * Interpolate given point list (defined via p_cntr) using Complete
 * Spline interpolation.
 */
static complete_spline_interp(p_cntr, n, t_min, t_max, tx1, ty1, tx2, ty2)
struct cntr_struct *p_cntr;
int n;
double t_min, t_max, tx1, ty1, tx2, ty2;
{
    double dt, *tangents_x, *tangents_y;
    int i;

    tangents_x = (double *) alloc((unsigned) (sizeof(double) * n),
						"contour c_s_intr");
    tangents_y = (double *) alloc((unsigned) (sizeof(double) * n),
						"contour c_s_intr");

    if (n > 1) prepare_spline_interp(tangents_x, tangents_y, p_cntr, n,
					t_min, t_max, tx1, ty1, tx2, ty2);
    else {
	free((char *) tangents_x);
	free((char *) tangents_y);
	return;
    }

    dt = (t_max-t_min)/(n-1);

    add_cntr_point(p_cntr -> X, p_cntr -> Y);	       /* First point. */

    for (i=0; i<n-1; i++) {
        hermit_interp(p_cntr -> X, p_cntr -> Y,
                     tangents_x[i], tangents_y[i],
		     p_cntr -> next -> X, p_cntr -> next -> Y,
                     tangents_x[i+1], tangents_y[i+1], dt);

        p_cntr = p_cntr -> next;
    }

    free((char *) tangents_x);
    free((char *) tangents_y);
}

/*
 * Routine to calculate intermidiate value of the Hermit Blending function:
 * This routine should be called only ONCE at the beginning of the program.
 */
static calc_hermit_table()
{
    int i;
    double t, dt;

    hermit_table = (table_entry *) alloc ((unsigned) (sizeof(table_entry) *
						(num_approx_pts + 1)),
						"contour hermit table");
    t = 0;
    dt = 1.0/num_approx_pts;
    for (i=0; i<=num_approx_pts; i++) {
        hermit_table[i][0] = (t-1)*(t-1)*(2*t+1);		     /* h00. */
        hermit_table[i][1] = t*t*(-2*t+3);			     /* h10. */
        hermit_table[i][2] = t*(t-1)*(t-1);			     /* h01. */
        hermit_table[i][3] = t*t*(t-1);				     /* h11. */
        t = t + dt;
    }
}

/*
 * Routine to generate an hermit interpolation between two points given as
 * two InterpStruct structures. Assume hermit_table is already calculated.
 * Currently the points generated are printed to stdout as two reals (X, Y).
 */
static hermit_interp(x1, y1, tx1, ty1, x2, y2, tx2, ty2, dt)
double x1, y1, tx1, ty1, x2, y2, tx2, ty2, dt;
{
    int i;
    double x, y, vec_size, tang_size;

    tx1 *= dt;  ty1 *= dt; /* Normalize the tangents according to param. t.  */
    tx2 *= dt;  ty2 *= dt;

    /* Normalize the tangents so that their magnitude will be 1/3 of the     */
    /* segment length. This tumb rule guaranteed no cusps or loops!          */
    /* Note that this normalization keeps continuity to be G1 (but not C1).  */
    vec_size = sqrt(sqr(x1 - x2) + sqr(y2 - y1));
    tang_size = sqrt(sqr(tx1) + sqr(ty1));                  /* Normalize T1. */
    if (tang_size * 3 > vec_size) {
	tx1 *= vec_size / (tang_size * 3);
	ty1 *= vec_size / (tang_size * 3);
    }
    tang_size = sqrt(sqr(tx2) + sqr(ty2));                  /* Normalize T2. */
    if (tang_size * 3 > vec_size) {
	tx2 *= vec_size / (tang_size * 3);
	ty2 *= vec_size / (tang_size * 3);
    }

    for (i=1; i<=num_approx_pts; i++) {      /* Note we start from 1 - first */
        x = hermit_table[i][0] * x1 +       /* point is not printed as it is */
            hermit_table[i][1] * x2 +   /* redundent (last on last section). */
            hermit_table[i][2] * tx1 +
            hermit_table[i][3] * tx2;
        y = hermit_table[i][0] * y1 +
            hermit_table[i][1] * y2 +
            hermit_table[i][2] * ty1 +
            hermit_table[i][3] * ty2;
	add_cntr_point(x, y);
    }
}

/*
 * Routine to Set up the 3*N mat for solve_tri_diag routine used in the
 * Complete Spline Interpolation. Returns TRUE of calc O.K.
 * Gets the points list in p_cntr (Of length n) and with tangent vectors tx1,
 * ty1 at starting point and tx2, ty2 and end point.
 */
static prepare_spline_interp(tangents_x, tangents_y, p_cntr, n, t_min, t_max,
			   tx1, ty1, tx2, ty2)
double tangents_x[], tangents_y[];
struct cntr_struct *p_cntr;
int n;
double t_min, t_max, tx1, ty1, tx2, ty2;
{
    int i;
    double *r, t, dt;
    tri_diag *m;		   /* The tri-diagonal matrix is saved here. */
    struct cntr_struct *p;

    m = (tri_diag *) alloc((unsigned) (sizeof(tri_diag) * n),
						"contour tri_diag");
    r = (double *) alloc((unsigned) (sizeof(double) * n),
						"contour tri_diag2");
    n--;

    p = p_cntr;
    m[0][0] = 0.0;    m[0][1] = 1.0;    m[0][2] = 0.0;
    m[n][0] = 0.0;    m[n][1] = 1.0;    m[n][2] = 0.0;
    r[0] = tx1;					       /* Set start tangent. */
    r[n] = tx2;						 /* Set end tangent. */
    t = t_min;
    dt = (t_max-t_min)/n;
    for (i=1; i<n; i++) {
       t = t + dt;
       m[i][0] = dt;
       m[i][2] = dt;
       m[i][1] = 2 * (m[i][0] + m[i][2]);
       r[i] = m[i][0] * ((p -> next -> X) - (p -> X)) / m[i][2]
            + m[i][2] * ((p -> next -> next -> X) - 
                         (p -> next -> X)) / m[i][0];
       r[i] *= 3.0;
       p = p -> next;
    }

    if (!solve_tri_diag(m, r, tangents_x, n+1)) { /* Find the X(t) tangents. */
    	free((char *) m);
    	free((char *) r);
	int_error("Cannt interpolate X using complete splines", NO_CARET);
    }

    p = p_cntr;
    m[0][0] = 0.0;    m[0][1] = 1.0;    m[0][2] = 0.0;
    m[n][0] = 0.0;    m[n][1] = 1.0;    m[n][2] = 0.0;
    r[0] = ty1;					       /* Set start tangent. */
    r[n] = ty2;						 /* Set end tangent. */
    t = t_min;
    dt = (t_max-t_min)/n;
    for (i=1; i<n; i++) {
       t = t + dt;
       m[i][0] = dt;
       m[i][2] = dt;
       m[i][1] = 2 * (m[i][0] + m[i][2]);
       r[i] = m[i][0] * ((p -> next -> Y) - (p -> Y)) / m[i][2]
            + m[i][2] * ((p -> next -> next -> Y) -
                         (p -> next -> Y)) / m[i][0];
       r[i] *= 3.0;
       p = p -> next;
    }

    if (!solve_tri_diag(m, r, tangents_y, n+1)) { /* Find the Y(t) tangents. */
    	free((char *) m);
    	free((char *) r);
	int_error("Cannt interpolate Y using complete splines", NO_CARET);
    }
    free((char *) m);
    free((char *) r);
}

/*
 * Solve tri diagonal linear system equation. The tri diagonal matrix is
 * defined via matrix M, right side is r, and solution X i.e. M * X = R.
 * Size of system given in n. Return TRUE if solution exist.
 */
static int solve_tri_diag(m, r, x, n)
tri_diag m[];
double r[], x[];
int n;
{
    int i;
    double t;

    for (i=1; i<n; i++) {   /* Eliminate element m[i][i-1] (lower diagonal). */
	if (m[i-1][1] == 0) return FALSE;
	t = m[i][0] / m[i-1][1];        /* Find ratio between the two lines. */
	m[i][0] = m[i][0] - m[i-1][1] * t;
	m[i][1] = m[i][1] - m[i-1][2] * t;
	r[i] = r[i] - r[i-1] * t;
    }
    /* Now do back subtitution - update the solution vector X: */
    if (m[n-1][1] == 0) return FALSE;
    x[n-1] = r[n-1] / m[n-1][1];		       /* Find last element. */
    for (i=n-2; i>=0; i--) {
	if (m[i][1] == 0) return FALSE;
	x[i] = (r[i] - x[i+1] * m[i][2]) / m[i][1];
    }
    return TRUE;
}

/*
 * Generate a Bspline curve defined by all the points given in linked list p:
 * Algorithm: using deBoor algorithm
 * Note: if Curvekind is OPEN_CONTOUR than Open end knot vector is assumed,
 *       else (CLOSED_CONTOUR) Float end knot vector is assumed.
 * It is assumed that num_of_points is at list 2, and order of Bspline is less
 * than num_of_points!
 */
static gen_bspline_approx(p_cntr, num_of_points, order, contour_kind)
struct cntr_struct *p_cntr;
int num_of_points, order, contour_kind;
{
    int i, knot_index = 0, pts_count = 1;
    double dt, t, next_t, t_min, t_max, x, y;
    struct cntr_struct *pc_temp = p_cntr, *pc_tail;

    /* If the contour is Closed one we must update few things:               */
    /* 1. Make the list temporary circular, so we can close the contour.     */
    /* 2. Update num_of_points - increase it by "order-1" so contour will be */
    /*    closed. This will evaluate order more sections to close it!        */
    if (contour_kind == CLOSED_CONTOUR) {
	pc_tail = p_cntr;
	while (pc_tail -> next) pc_tail = pc_tail -> next;/* Find last point.*/
	pc_tail -> next = p_cntr;   /* Close contour list - make it circular.*/
	num_of_points += order;
    }

    /* Find first (t_min) and last (t_max) t value to eval: */
    t = t_min = fetch_knot(contour_kind, num_of_points, order, order);
    t_max = fetch_knot(contour_kind, num_of_points, order, num_of_points);
    next_t = t_min + 1.0;
    knot_index = order;
    dt = 1.0/num_approx_pts;            /* Number of points per one section. */


    while (t<t_max) {
	if (t > next_t) {
	    pc_temp = pc_temp -> next;     /* Next order ctrl. pt. to blend. */
            knot_index++;
	    next_t += 1.0;
	}
        eval_bspline(t, pc_temp, num_of_points, order, knot_index,
    					contour_kind, &x, &y);   /* Next pt. */
	add_cntr_point(x, y);
	pts_count++;
	/* As we might have some real number round off problems we must      */
	/* test if we dont produce too many points here...                   */
	if (pts_count + 1 == num_approx_pts * (num_of_points - order) + 1)
    		break;
        t += dt;
    }

    eval_bspline(t_max - EPSILON, pc_temp, num_of_points, order, knot_index,
		contour_kind, &x, &y);
    /* If from round off errors we need more than one last point: */
    for (i=pts_count; i<num_approx_pts * (num_of_points - order) + 1; i++)
	add_cntr_point(x, y);			    /* Complete the contour. */

    if (contour_kind == CLOSED_CONTOUR)     /* Update list - un-circular it. */
	pc_tail -> next = NULL;
}

/*
 * The recursive routine to evaluate the B-spline value at point t using
 * knot vector PKList, and the control points Pdtemp. Returns x, y after the
 * division by the weight w. Note that Pdtemp points on the first control
 * point to blend with. The B-spline is of order order.
 */
static eval_bspline(t, p_cntr, num_of_points, order, j, contour_kind, x, y)
double t;
struct cntr_struct *p_cntr;
int num_of_points, order, j, contour_kind;
double *x, *y;
{
    int i, p;
    double ti, tikp, *dx, *dy;      /* Copy p_cntr into it to make it faster. */

    dx = (double *) alloc((unsigned) (sizeof(double) * (order + j)),
						"contour b_spline");
    dy = (double *) alloc((unsigned) (sizeof(double) * (order + j)),
						"contour b_spline");
    /* Set the dx/dy - [0] iteration step, control points (p==0 iterat.): */
    for (i=j-order; i<=j; i++) {
        dx[i] = p_cntr -> X;
        dy[i] = p_cntr -> Y;
        p_cntr = p_cntr -> next;
    }

    for (p=1; p<=order; p++) {        /* Iteration (b-spline level) counter. */
	for (i=j; i>=j-order+p; i--) {           /* Control points indexing. */
            ti = fetch_knot(contour_kind, num_of_points, order, i);
            tikp = fetch_knot(contour_kind, num_of_points, order, i+order+1-p);
	    if (ti == tikp) {   /* Should not be a problems but how knows... */
	    }
	    else {
		dx[i] = dx[i] * (t - ti)/(tikp-ti) +         /* Calculate x. */
			dx[i-1] * (tikp-t)/(tikp-ti);
		dy[i] = dy[i] * (t - ti)/(tikp-ti) +         /* Calculate y. */
			dy[i-1] * (tikp-t)/(tikp-ti);
	    }
	}
    }
    *x = dx[j]; *y = dy[j];
    free((char *) dx);
    free((char *) dy);
}

/*
 * Routine to get the i knot from uniform knot vector. The knot vector
 * might be float (Knot(i) = i) or open (where the first and last "order"
 * knots are equal). contour_kind determines knot kind - OPEN_CONTOUR means
 * open knot vector, and CLOSED_CONTOUR selects float knot vector.
 * Note the knot vector is not exist and this routine simulates it existance
 * Also note the indexes for the knot vector starts from 0.
 */
static double fetch_knot(contour_kind, num_of_points, order, i)
int contour_kind, num_of_points, order, i;
{
    switch (contour_kind) {
	case OPEN_CONTOUR:
	    if (i <= order) return 0.0;
	    else if (i <= num_of_points) return (double) (i - order);
		 else return (double) (num_of_points - order);
	case CLOSED_CONTOUR:
	    return (double) i;
	default: /* Should never happen */
	    return 1.0;
    }
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/corgraph.asm version [b9f68e538e].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
TITLE	Corona graphics module
;	Colin Kelley
;	January 1987

include header.mac

if1
include lineproc.mac
endif


_text	segment

public	_GrInit,_GrReset,_GrOnly,_TxOnly,_GrandTx,_Cor_line,_Cor_mask

corpixel proc near
	ror word ptr linemask,1
	jc cont
	ret
cont:	push bp
	mov bp,sp
	push ax
	push bx
	push cx
	mov es,ScSeg
	shl bx,1			; y
	mov bx,word ptr LookUp[bx] ; bx has y mem address
	mov cl,al			; x
	and cl,7
	shr ax,1
	shr ax,1
	shr ax,1			; ax /= 8
	add bx,ax
	mov al,1
	shl al,cl			; al contains bit mask
	or byte ptr es:[bx],al
	pop cx
	pop bx
	pop ax
	pop bp
	ret

lineproc _Cor_line, corpixel

beginproc _GrInit
	push bp
	mov bp,sp
	push di
	mov ax, [bp+X]			; screen number (0 - 7)
	mov cl,11
	shl ax,cl			; multiply by 2048 to get segment
	mov ScSeg,ax			; save segment for later
	push ax
	mov es, ax
	xor ax,ax
	mov di,ax
	mov cx, 4000h
	cld
	rep stosw
	pop cx
	call near ptr GrAddr
	mov ax,es
	pop di
	pop bp
	ret
_GrInit	endp

beginproc _GrReset
	mov cx, 0
	call near ptr GrAddr
	ret
_GrReset endp

GrAddr	proc near
	mov dx,3b4h			; address of 6845
	mov al,0ch			; register 12
	out dx,al
	inc dx
	mov al,ch			; Graphics Segment High
	out dx,al
	dec dx
	mov al,0dh			; register 13
	out dx,al
	mov al,cl			; Graphics Segment Low
	inc dx
	out dx,al
	ret
GrAddr	endp

beginproc _GrOnly
	mov dx,3b8h
	mov al,0a0h
	out dx,al
	ret
_GrOnly	endp

beginproc _TxOnly
	mov dx,3b8h
	mov al,28h
	out dx,al
	ret
_TxOnly	endp

beginproc _GrandTx
	mov dx,3b8h
	mov al,0a8h
	out dx,al
	ret
_GrandTx endp

beginproc _Cor_mask
	push bp
	mov bp,sp
	mov ax,[bp+x]			; mask
	mov linemask,ax
	pop bp
	ret
_Cor_mask endp

corpixel endp

_text	ends
 

_data	segment
linemask dw -1
ScSeg	dw 0
_data	ends

const	segment

K	equ 1024

mem_mac	MACRO x
	dw x,2*K+x,4*K+x,6*K+x,8*K+x,10*K+x,12*K+x,14*K+x,16*K+x
	dw 18*K+x,20*K+x,22*K+x,24*K+x
	ENDM
LookUp	equ $
	mem_mac 0
	mem_mac 80
	mem_mac (80*2)
	mem_mac (80*3)
	mem_mac (80*4)
	mem_mac (80*5)
	mem_mac (80*6)
	mem_mac (80*7)
	mem_mac (80*8)
	mem_mac (80*9)
	mem_mac (80*10)
	mem_mac (80*11)
	mem_mac (80*12)
	mem_mac (80*13)
	mem_mac (80*14)
	mem_mac (80*15)
	mem_mac (80*16)
	mem_mac (80*17)
	mem_mac (80*18)
	mem_mac (80*19)
	mem_mac (80*20)
	mem_mac (80*21)
	mem_mac (80*22)
	mem_mac (80*23)
	mem_mac (80*24)

const	ends

	end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































































































































Deleted r34.1/plot/corplot.c version [bae53e1a29].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef lint
static char *RCSid = "$Id: corplot.c,v 3.26 92/03/24 22:36:10 woo Exp Locker: woo $";
#endif

/* GNUPLOT - corplot.c */
/*
 * Copyright (C) 1986, 1987, 1990, 1991, 1992   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 * 
 *   Original Software:
 *     Thomas Williams,  Colin Kelley.
 * 
 *   Gnuplot 2.0 additions:
 *       Russell Lang, Dave Kotz, John Campbell.
 *
 *   Gnuplot 3.0 additions:
 *       Gershon Elber and many others.
 * 
 * Send your comments or suggestions to 
 *  info-gnuplot@ames.arc.nasa.gov.
 * This is a mailing list; to join it send a note to 
 *  info-gnuplot-request@ames.arc.nasa.gov.  
 * Send bug reports to
 *  bug-gnuplot@ames.arc.nasa.gov.
 */
#include <stdio.h>
#include <process.h>
#include <dos.h>

#define BOUNDARY 32768
#define segment(addr) (FP_SEG(m) + ((FP_OFF(m)+15) >> 4));
#define round(value,boundary) (((value) + (boundary) - 1) & ~((boundary) - 1))

char *malloc(),*realloc();

char prog[] = "gnuplot";
char corscreen[] = "CORSCREEN=0";

main()
{
register unsigned int segm,start;
char *m;
	if (!(m = malloc(BOUNDARY))) {
		printf("malloc() failed\n");
		exit(1);
	}
	segm = segment(m);
	start = round(segm,BOUNDARY/16);

	if (realloc(m,BOUNDARY+(start-segm)*16) != m) {
		printf("can't realloc() memory\n");
		exit(2);
	}

	if ((segm = start >> 11) >= 8) {
		printf("not enough room in first 256K\n");
		exit(3);
	}

	corscreen[sizeof(corscreen)-2] = '0' + segm;
	if (putenv(corscreen))
		perror("putenv");

	if (spawnlp(P_WAIT,prog,prog,NULL))
		perror("spawnlp");
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































































































Deleted r34.1/plot/demo/1.dat version [8fc8e61db4].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# $Id: 1.dat,v 3.26 92/03/24 22:32:15 woo Exp Locker: woo $
#
-20.000000 -3.041676
-19.000000 -3.036427
-18.000000 -3.030596
-17.000000 -3.024081
-16.000000 -3.016755
-15.000000 -3.008456
-14.000000 -2.998978
-13.000000 -2.988049
-12.000000 -2.975310
-11.000000 -2.960273
-10.000000 -2.942255
-9.000000 -2.920278
-8.000000 -2.892883
-7.000000 -2.857799
-6.000000 -2.811295
-5.000000 -2.746802
-4.000000 -2.651635
-3.000000 -2.498092
-2.000000 -2.214297
-1.000000 -1.570796
0.000000 0.000000
1.000000 1.570796
2.000000 2.214297
3.000000 2.498092
4.000000 2.651635
5.000000 2.746802
6.000000 2.811295
7.000000 2.857799
8.000000 2.892883
9.000000 2.920278
10.000000 2.942255
11.000000 2.960273
12.000000 2.975310
13.000000 2.988049
14.000000 2.998978
15.000000 3.008456
16.000000 3.016755
17.000000 3.024081
18.000000 3.030596
19.000000 3.036427
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































Deleted r34.1/plot/demo/2.dat version [038f4ade56].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# $Id: 2.dat,v 3.26 92/03/24 22:32:16 woo Exp Locker: woo $
#
-20.000000 -6.083352
-19.000000 -6.072853
-18.000000 -6.061191
-17.000000 -6.048162
-16.000000 -6.033510
-15.000000 -6.016913
-14.000000 -5.997955
-13.000000 -5.976098
-12.000000 -5.950620
-11.000000 -5.920546
-10.000000 -5.884511
-9.000000 -5.840556
-8.000000 -5.785765
-7.000000 -5.715597
-6.000000 -5.622591
-5.000000 -5.493603
-4.000000 -5.303271
-3.000000 -4.996183
-2.000000 -4.428595
-1.000000 -3.141593
0.000000 0.000000
1.000000 3.141593
2.000000 4.428595
3.000000 4.996183
4.000000 5.303271
5.000000 5.493603
6.000000 5.622591
7.000000 5.715597
8.000000 5.785765
9.000000 5.840556
10.000000 5.884511
11.000000 5.920546
12.000000 5.950620
13.000000 5.976098
14.000000 5.997955
15.000000 6.016913
16.000000 6.033510
17.000000 6.048162
18.000000 6.061191
19.000000 6.072853
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































Deleted r34.1/plot/demo/3.dat version [a1b7dbeae5].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# $Id: 3.dat,v 3.26 92/03/24 22:32:17 woo Exp Locker: woo $
#
-20.000000 -9.125028
-19.000000 -9.109280
-18.000000 -9.091787
-17.000000 -9.072243
-16.000000 -9.050265
-15.000000 -9.025369
-14.000000 -8.996933
-13.000000 -8.964147
-12.000000 -8.925931
-11.000000 -8.880819
-10.000000 -8.826766
-9.000000 -8.760835
-8.000000 -8.678648
-7.000000 -8.573396
-6.000000 -8.433886
-5.000000 -8.240405
-4.000000 -7.954906
-3.000000 -7.494275
-2.000000 -6.642892
-1.000000 -4.712389
0.000000 0.000000
1.000000 4.712389
2.000000 6.642892
3.000000 7.494275
4.000000 7.954906
5.000000 8.240405
6.000000 8.433886
7.000000 8.573396
8.000000 8.678648
9.000000 8.760835
10.000000 8.826766
11.000000 8.880819
12.000000 8.925931
13.000000 8.964147
14.000000 8.996933
15.000000 9.025369
16.000000 9.050265
17.000000 9.072243
18.000000 9.091787
19.000000 9.109280
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































Deleted r34.1/plot/demo/all.demo version [6d4a85755b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# $Id: all.demo,v 3.26 92/03/24 22:32:37 woo Exp Locker: woo $
#
#
# Executes ALL demos in this directory, in functionality order.
#

pause 0 "******************** file simple.demo ********************"
load "simple.demo"

pause 0 "******************** file controls.demo ********************"
load "controls.demo"

pause 0 "******************** file electron.demo ********************"
load "electron.demo"

pause 0 "******************** file using.demo ********************"
load "using.demo"

pause 0 "******************** file errorbar.demo ********************"
load "errorbar.demo"

pause 0 "******************** file param.demo ********************"
load "param.demo"

pause 0 "******************** file polar.demo ********************"
load "polar.demo"

pause 0 "******************** file poldat.demo ********************"
load "poldat.demo"

pause 0 "******************** file surface1.demo ********************"
load "surface1.demo"

pause 0 "******************** file surface2.demo ********************"
load "surface2.demo"

pause 0 "******************** file contours.demo ********************"
load "contours.demo"

pause 0 "******************** file hidden.demo ********************"
load "hidden.demo"

pause 0 "******************** file world.demo ********************"
load "world.demo"

pause 0 "******************** file bivariat.demo ********************"
load "bivariat.demo"
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































Deleted r34.1/plot/demo/antenna.dat version [b457580671].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
#
# $Id: antenna.dat,v 3.26 92/03/24 22:32:36 woo Exp Locker: woo $
#
   0.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
   2.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
   4.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
   6.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
   8.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
  10.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
  12.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
  14.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
  16.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
  18.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
  20.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
  22.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
  24.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
  26.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
  28.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
  30.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
  32.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
  34.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
  36.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
  38.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
  40.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
  42.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
  44.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
  46.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
  48.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
  50.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
  52.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
  54.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
  56.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
  58.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
  60.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
  62.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
  64.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
  66.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
  68.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
  70.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
  72.000 -41.802E+00 -37.180E+00 -39.114E+00 -24.830E+00
  74.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
  76.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
  78.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
  80.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
  82.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
  84.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
  86.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
  88.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
  90.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
  92.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
  94.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
  96.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
  98.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 100.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 102.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 104.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 106.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 108.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 110.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 112.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 114.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 116.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 118.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 120.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 122.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 124.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 126.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 128.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 130.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 132.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 134.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 136.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 138.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 140.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 142.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 144.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 146.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 148.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 150.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 152.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 154.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 156.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 158.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 160.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 162.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 164.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 166.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 168.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 170.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 172.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 174.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 176.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 178.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 180.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
 182.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 184.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 186.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 188.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 190.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 192.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 194.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 196.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 198.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 200.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 202.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 204.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 206.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 208.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 210.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 212.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 214.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 216.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 218.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 220.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 222.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 224.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 226.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 228.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 230.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 232.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 234.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 236.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 238.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 240.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 242.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 244.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 246.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 248.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 250.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 252.000 -41.802E+00 -37.180E+00 -39.114E+00 -24.830E+00
 254.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 256.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 258.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 260.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 262.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 264.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 266.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 268.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 270.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
 272.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 274.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 276.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 278.000  13.099E-02  42.554E-01 -25.105E+00  59.101E-01
 280.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 282.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 284.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 286.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 288.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 290.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 292.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 294.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 296.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 298.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 300.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 302.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 304.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 306.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 308.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 310.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 312.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 314.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 316.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 318.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 320.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 322.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 324.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 326.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 328.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 330.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 332.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 334.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 336.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 338.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 340.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 342.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 344.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 346.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 348.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 350.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 352.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 354.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 356.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 358.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 360.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
   2.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
   4.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
   6.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
   8.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
  10.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
  12.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
  14.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
  16.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
  18.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
  20.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
  22.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
  24.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
  26.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
  28.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
  30.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
  32.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
  34.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
  36.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
  38.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
  40.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
  42.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
  44.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
  46.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
  48.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
  50.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
  52.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
  54.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
  56.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
  58.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
  60.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
  62.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
  64.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
  66.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
  68.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
  70.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
  72.000 -41.802E+00 -37.180E+00 -39.114E+00 -24.830E+00
  74.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
  76.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
  78.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
  80.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
  82.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
  84.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
  86.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
  88.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
  90.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
  92.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
  94.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
  96.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
  98.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 100.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 102.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 104.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 106.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 108.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 110.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 112.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 114.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 116.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 118.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 120.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 122.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 124.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 126.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 128.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 130.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 132.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 134.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 136.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 138.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 140.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 142.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 144.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 146.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 148.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 150.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 152.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 154.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 156.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 158.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 160.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 162.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 164.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 166.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 168.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 170.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 172.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 174.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 176.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 178.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 180.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
 182.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 184.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 186.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 188.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 190.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 192.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 194.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 196.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 198.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 200.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 202.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 204.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 206.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 208.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 210.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 212.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 214.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 216.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 218.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 220.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 222.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 224.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 226.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 228.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 230.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 232.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 234.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 236.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 238.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 240.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 242.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 244.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 246.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 248.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 250.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 252.000 -41.802E+00 -37.180E+00 -39.114E+00 -24.830E+00
 254.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 256.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 258.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 260.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 262.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 264.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 266.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 268.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 270.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
 272.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 274.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 276.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 278.000  13.099E-02  42.554E-01 -25.105E+00  59.101E-01
 280.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 282.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 284.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 286.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 288.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 290.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 292.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 294.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 296.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 298.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 300.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 302.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 304.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 306.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 308.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 310.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 312.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 314.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 316.000 -39.287E+00 -23.397E+00 -38.646E+00 -60.943E-01
 318.000 -38.418E+00 -14.735E+00 -29.897E+00 -76.375E-01
 320.000 -36.549E+00 -12.197E+00 -27.142E+00 -11.075E+00
 322.000 -35.220E+00 -12.594E+00 -27.052E+00 -15.787E+00
 324.000 -35.691E+00 -16.286E+00 -29.566E+00 -13.578E+00
 326.000 -37.632E+00 -21.690E+00 -37.458E+00 -96.424E-01
 328.000 -33.989E+00 -13.340E+00 -38.930E+00 -75.039E-01
 330.000 -28.216E+00 -83.757E-01 -29.576E+00 -64.985E-01
 332.000 -24.356E+00 -58.580E-01 -26.299E+00 -60.712E-01
 334.000 -22.103E+00 -48.803E-01 -25.429E+00 -59.416E-01
 336.000 -21.258E+00 -52.193E-01 -26.432E+00 -62.183E-01
 338.000 -22.060E+00 -71.064E-01 -29.743E+00 -74.312E-01
 340.000 -25.979E+00 -11.868E+00 -38.677E+00 -10.860E+00
 342.000 -41.802E+00 -37.181E+00 -39.114E+00 -24.830E+00
 344.000 -20.405E+00 -10.185E+00 -30.112E+00 -11.564E+00
 346.000 -12.849E+00 -36.543E-01 -26.702E+00 -36.253E-01
 348.000 -76.407E-01  15.917E-02 -25.211E+00  82.257E-02
 350.000 -34.589E-01  26.769E-01 -24.794E+00  38.084E-01
 352.000  13.100E-02  42.554E-01 -25.105E+00  59.101E-01
 354.000  33.053E-01  48.742E-01 -26.062E+00  73.795E-01
 356.000  60.696E-01  40.782E-01 -28.040E+00  83.501E-01
 358.000  81.667E-01  13.355E-02 -32.735E+00  89.007E-01
 360.000  90.007E-01 -35.926E+00 -71.297E+00  90.783E-01
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/demo/bivariat.demo version [9e5917546b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# $Id: bivariat.demo,v 3.26 92/03/24 22:32:38 woo Exp Locker: woo $
#
#
# This demo is very slow and requires unusually large stack size.
# Do not attempt to run this demo under MSDOS.
#

# the function integral_f(x) approximates the integral of f(x) from 0 to x.
# integral2_f(x,y) approximates the integral from x to y.
# define f(x) to be any single variable function
#
# the integral is calculated as the sum of f(x_n)*delta 
#   do this x/delta times (from x down to 0)
#
f(x) = exp(-x**2)
delta = 0.025
#
# integral_f(x) takes one variable, the upper limit.  0 is the lower limit.
# calculate the integral of function f(t) from 0 to x
integral_f(x) = (x>0)?integral1a(x):-integral1b(x)
integral1a(x) = (x<=0)?0:(integral1a(x-delta)+delta*f(x))
integral1b(x) = (x>=0)?0:(integral1b(x+delta)+delta*f(x))
#
# integral2_f(x,y) takes two variables; x is the lower limit, and y the upper.
# claculate the integral of function f(t) from x to y
integral2_f(x,y) = (x<y)?integral2(x,y):-integral2(y,x)
integral2(x,y) = (x>y)?0:(integral2(x+delta,y)+delta*f(x))

set title "approximate the integral of functions"
set samples 50

plot [-5:5] f(x) title "f(x)=exp(-x**2)", 2/sqrt(pi)*integral_f(x) title "erf(x)=2/sqrt(pi)*integral_f(x)"

pause -1 "Hit return to continue"

f(x)=sin(x)

plot [-5:5] f(x) title "f(x)=sin(x)", integral_f(x)

pause -1 "Hit return to continue"

set title "approximate the integral of functions (upper and lower limits)"

f(x)=(x-2)**2-20

plot [-10:10] f(x) title "f(x)=(x-2)**2-20", integral2_f(-5,x)

pause -1 "Hit return to continue"

f(x)=sin(x-1)-.75*sin(2*x-1)+(x**2)/8-5

plot  [-10:10] f(x) title "f(x)=sin(x-1)-0.75*sin(2*x-1)+(x**2)/8-5", integral2_f(x,1)

pause -1 "Hit return to continue"

#
# This definition computes the ackermann. Do not attempt to compute its
# values for non integral values. In addition, do not attempt to compute
# its beyond m = 3, unless you want to wait really long time.

ack(m,n) = (m == 0) ? n + 1 : (n == 0) ? ack(m-1,1) : ack(m-1,ack(m,n-1))

set xrange [0:3]
set yrange [0:3]

set isosamples 4
set samples 4

set title "Plot of the ackermann function"

splot ack(x, y)

pause -1 "Hit return to continue"

set xrange [-5:5]
set yrange [-10:10]
set isosamples 10
set samples 100
set key 4,-3
set title "Min(x,y) and Max(x,y)"

#
min(x,y) = (x < y) ? x : y
max(x,y) = (x > y) ? x : y

plot sin(x), x**2, x**3, max(sin(x), min(x**2, x**3))+0.5

pause -1 "Hit return to continue"

#
# gcd(x,y) finds the greatest common divisor of x and y,
#          using Euclid's algorithm
# as this is defined only for integers, first round to the nearest integer
gcd(x,y) = gcd1(rnd(max(x,y)),rnd(min(x,y)))
gcd1(x,y) = (y == 0) ? x : gcd1(y, x - x/y * y)
rnd(x) = int(x+0.5)

set samples 59
set xrange [1:59]
set auto
set key

set title "Greatest Common Divisor (for integers only)"

plot gcd(x, 60)
pause -1 "Hit return to continue"

set xrange [-10:10]
set yrange [-10:10]
set auto
set isosamples 10
set samples 100
set title ""

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































































































































































































Deleted r34.1/plot/demo/contours.demo version [fba94e5bd9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# $Id: contours.demo,v 3.26 92/03/24 22:32:18 woo Exp Locker: woo $
#
set samples 20
set isosamples 21
set xlabel "X axis" -5,-2
set ylabel "Y axis" 4,-1
set zlabel "Z axis"
set title "3D gnu plot demo - contour plot"
set contour
splot x*y
pause -1 "Hit return to continue (1)"
set cntrparam levels 20
set title "3D gnu plot demo - contour plot (more contours)"
replot
pause -1 "Hit return to continue (2)"
set cntrparam levels 40
set title "3D gnu plot demo - contour plot (and again more contours)"
replot
pause -1 "Hit return to continue (3)"
set cntrparam levels 10
set title "3D gnu plot demo - contour plot on base grid"
set contour base
splot x**2-y**2
pause -1 "Hit return to continue (4)"
set title "3D gnu plot demo - contour plot on surface"
set contour surface
replot
pause -1 "Hit return to continue (5)"
set title "3D gnu plot demo - contour plot on both"
set contour both
replot
pause -1 "Hit return to continue (6)"
set contour base
set title "3D gnu plot demo - 2 surfaces
splot x**2*y**3, x**3*y**2
pause -1 "Hit return to continue (7)"
set title "3D gnu plot demo - some more interesting contours"
splot x*y / (x**2 + y**2 + 0.1)
pause -1 "Hit return to continue (8)"
splot [x=-3:3] [y=-3:3] sin(x) * cos(y)
pause -1 "Hit return to continue (9)"
set zrange [-0.5:0.5]
replot
pause -1 "Hit return to continue (10)"
set samples 6
set isosamples 6
set cntrparam levels 5
set title "3D gnu plot demo - low resolution (6x6)"
replot
pause -1 "Hit return to continue (11)"
set cntrparam bspline
set title "3D gnu plot demo - low resolution (6x6) using bspline approx."
replot
pause -1 "Hit return to continue (12)"
set cntrparam order 8
set title "3D gnu plot demo - low resolution (6x6) raise bspline order."
replot
pause -1 "Hit return to continue (13)"
set cntrparam linear
set auto
set title "3D gnu plot demo - low resolution (6x6) using linear contours."
splot x*y
pause -1 "Hit return to continue (14)"
set cntrparam order 4
set cntrparam bspline
set title "3D gnu plot demo - low resolution (6x6) using bspline approx."
replot
pause -1 "Hit return to continue (15)"
set samples 25
set isosamples 26
set title "3D gnu plot demo - contour of Sinc function"
splot [-5:5.01] [-5:5.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
pause -1 "Hit return to continue (16)"
splot [-12:12.01] [-12:12.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
pause -1 "Hit return to continue (17)"
set cntrparam levels 10
set xrange [0:15]
set yrange [0:15]
set auto
set zrange [-0.6:0.6]
set data style lines
set title "3D gnu plot demo - contour of data grid plotting"
set parametric
splot "glass.dat"
pause -1 "Hit return to continue (18)"
set zrange [-1.2:1.2]
set noparametric
splot "glass.dat" using 1
pause -1 "Hit return to continue (19)"
set view 0,0,1
set nosurface
set title "3D gnu plot demo - 2D contour projection of last plot"
replot
pause -1 "Hit return to continue (20)"


#
# Clean up:
#
set surface
set nocontour
set cntrparam levels 5
set cntrparam linear
set samples 100
set isosamples 10
set view 60,30,1,1
set xrange [-10:10]
set yrange [-10:10]
set zrange [-10:10]
set auto
set title "" 0,0
set xlabel "" 0,0
set ylabel "" 0,0
set zlabel "" 0,0
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































































































































































































Deleted r34.1/plot/demo/controls.demo version [df8498ee4d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#
# $Id: controls.demo,v 3.26 92/03/24 22:32:19 woo Exp Locker: woo $
#
#
# warning:  this demo is SLOW on PCs without math coprocessors!
#
# From _Automatic_Control_Systems_, fourth ed., figure 6-14
# transient response of a second-order system to a unit step input function
#
damp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
per(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
c(t) = 1-damp(t)*per(t)
#
#	wn is natural undamped frequency
#	s is damping factor
#
wn = 1.0
set xrange [0:13]
set samples 50
set dummy t
#
# plot c(t) for several different damping factors s
#
plot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
pause -1 "Hit return to continue"

# undo what we have done
set xrange [-10:10]
set autoscale xy
set samples 160
set dummy x

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































Deleted r34.1/plot/demo/electron.demo version [766e1bc5de].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# $Id: electron.demo,v 3.26 92/03/24 22:32:20 woo Exp Locker: woo $
#
# Electronics demo
#
# Bipolar Transistor (NPN) Mutual Characteristic
Ie(Vbe)=Ies*exp(Vbe/kT_q)
Ic(Vbe)=alpha*Ie(Vbe)+Ico
alpha = 0.99
Ies = 4e-14
Ico = 1e-09
kT_q = 0.025
set dummy Vbe
set grid
set offsets
set nolog
set nopolar
set samples 160
set title "Mutual Characteristic of a Transistor"
set xlabel "Vbe (base emmitter voltage)"
set xrange [0 : 0.75]
set ylabel "Ic (collector current)"
set yrange [0 : 0.005]
set key .2,.0045
set format y "%.4f"
plot Ic(Vbe)
set format "%g"

pause -1 "Hit return to continue"

# Junction Field Effect Transistor (JFET) Mutual Characteristic
# drain current above pinch off
Ida(Vd)=Ido*(1-Vg/Vp)**2
# drain current below pinch off
Idb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)
# drain current
Id(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)
# drain current at zero gate voltage
Ido = 2.5
# pinch off voltage
Vp = -1.25
# gate voltage
Vg = 0
set dummy Vd
set nogrid
set nokey
set offsets 0, 1, 0, 0
set title "JFET Mutual Characteristic"
set xlabel "Drain voltage Vd (V)"
set xrange [0 : 4]
set ylabel "Drain current Id (mA)"
set yrange [0 : 5]
set label "-0.5 Vp" at 4.1,0.625
set label "-0.25 Vp" at 4.1,1.4
set label "0" at 4.1,2.5
set label "Vg = 0.5 Vp" at 4.1,3.9
plot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)
set nolabel

pause -1 "Hit return to continue"

# amplitude frequency response
A(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))
p1 = 10
p2 = 10000
set dummy jw
set grid
set key
set logscale xy
set offsets 0, 0, 0, 0
set title "Amplitude Frequency Response"
set xlabel "jw (radians)"
set xrange [1.1 : 90000.0]
set ylabel "magnitude of A(jw)"
set autoscale  y
plot abs(A(jw))

pause -1 "Hit return to continue"

# phase frequency response
set nolog y
set logscale x
set title "Phase Frequency Response"
set ylabel "Phase of A(jw) (degrees)"
plot 180/pi*arg(A(jw))

pause -1 "Hit return to continue"

# undo what we've done
set dummy x
set nogrid
set offsets 0,0,0,0
set title ""
set ylabel ""
set xlabel ""
set xrange [-10:10]
set autoscale xy
set key
set format xy "%g"
set nolabel
set nolog
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































































































































Deleted r34.1/plot/demo/err.dat version [1bb5afc797].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# $Id: err.dat,v 3.26 92/03/24 22:32:32 woo Exp Locker: woo $
#
0	11.062	9.757	12.667	2.345
2	9.212	8.0908	10.932	1.725
5	8.55	7.6612	9.0388	2.846
10	8.122	7.327	8.617	0.957
15	8.156	7.6101	8.9019	1.577
20	8.122	7.5431	8.8009	3.141
25	7.988	6.3007	9.2753	1.57
27	8.096	6.665	10.555	2.172
29	7.936	6.9395	8.325	0.582
30	7.854	6.4909	9.8171	0.603
35	8.01	7.1556	8.644	1.063
40	8.02	7.0301	9.7099	2.152
45	8.092	6.9164	9.7676	1.44
50	8.072	7.2993	8.4447	1.96
60	8.286	7.7265	8.755	1.0
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































Deleted r34.1/plot/demo/errorbar.demo version [dc3207f404].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# $Id: errorbar.demo,v 3.26 92/03/24 22:32:35 woo Exp Locker: woo $
#
#
# Requires data file "err.dat" from this directory,
# so change current working directory to this directory before running.
# gnuplot> set term <term-type>
# gnuplot> load 'errorbar.demo'
#

set title "Demonstration of error bars (both ylow and yhigh, default format)"
plot [-3:65] "err.dat" with errorbars

pause -1 "Hit return to continue"

# this should look the same
set title "Demonstration of error bars (both ylow and yhigh)"
plot [-3:65] "err.dat" using 1:2:3:4 with errorbars

pause -1 "Hit return to continue"

set title "Demonstration of error bars (only ydelta)"
plot [-3:65] "err.dat" using 1:2:5 with errorbars

pause -1 "Hit return to continue"

set title "Plot data file twice to get lines and errorbars"
plot [-3:65] [6:14] "err.dat" with lines, "err.dat" using 1:2:4:3 with errorbars

set title ""
set autoscale

pause -1 "Hit return to continue"
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































































Deleted r34.1/plot/demo/glass.dat version [a34893693d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#
# $Id: glass.dat,v 3.26 92/03/24 22:32:21 woo Exp Locker: woo $
#
#
# 16x16 grid Glass shape. Created Using DRAWFN3D, Gershon Elber 1990.
#
  0.568000   0.000000  -0.911000
  0.518894   0.231026  -0.911000
  0.380066   0.422106  -0.911000
  0.175522   0.540200  -0.911000
 -0.059372   0.564888  -0.911000
 -0.284000   0.491902  -0.911000
 -0.459522   0.333862  -0.911000
 -0.555588   0.118094  -0.911000
 -0.555588  -0.118094  -0.911000
 -0.459522  -0.333862  -0.911000
 -0.284000  -0.491902  -0.911000
 -0.059372  -0.564888  -0.911000
  0.175522  -0.540200  -0.911000
  0.380066  -0.422106  -0.911000
  0.518894  -0.231027  -0.911000
  0.568000  -0.000000  -0.911000

  0.341741   0.000000  -0.905215
  0.312196   0.138999  -0.905215
  0.228669   0.253963  -0.905215
  0.105604   0.325015  -0.905215
 -0.035722   0.339869  -0.905215
 -0.170870   0.295956  -0.905215
 -0.276474   0.200870  -0.905215
 -0.334273   0.071052  -0.905215
 -0.334273  -0.071052  -0.905215
 -0.276474  -0.200870  -0.905215
 -0.170871  -0.295956  -0.905215
 -0.035722  -0.339869  -0.905215
  0.105604  -0.325015  -0.905215
  0.228669  -0.253963  -0.905215
  0.312196  -0.138999  -0.905215
  0.341741  -0.000000  -0.905215

  0.212153   0.000000  -0.863178
  0.193812   0.086290  -0.863178
  0.141958   0.157661  -0.863178
  0.065559   0.201770  -0.863178
 -0.022176   0.210991  -0.863178
 -0.106077   0.183730  -0.863178
 -0.171636   0.124701  -0.863178
 -0.207517   0.044109  -0.863178
 -0.207517  -0.044109  -0.863178
 -0.171636  -0.124701  -0.863178
 -0.106077  -0.183730  -0.863178
 -0.022176  -0.210991  -0.863178
  0.065559  -0.201770  -0.863178
  0.141958  -0.157661  -0.863178
  0.193812  -0.086291  -0.863178
  0.212153  -0.000000  -0.863178

  0.138097   0.000000  -0.764660
  0.126157   0.056169  -0.764660
  0.092405   0.102626  -0.764660
  0.042674   0.131338  -0.764660
 -0.014435   0.137340  -0.764660
 -0.069048   0.119595  -0.764660
 -0.111722   0.081171  -0.764660
 -0.135079   0.028712  -0.764660
 -0.135079  -0.028712  -0.764660
 -0.111722  -0.081171  -0.764660
 -0.069048  -0.119595  -0.764660
 -0.014435  -0.137340  -0.764660
  0.042674  -0.131338  -0.764660
  0.092405  -0.102626  -0.764660
  0.126157  -0.056169  -0.764660
  0.138097  -0.000000  -0.764660

  0.098588   0.000000  -0.618872
  0.090065   0.040099  -0.618872
  0.065968   0.073265  -0.618872
  0.030465   0.093763  -0.618872
 -0.010305   0.098048  -0.618872
 -0.049294   0.085380  -0.618872
 -0.079760   0.057949  -0.618872
 -0.096434   0.020498  -0.618872
 -0.096434  -0.020498  -0.618872
 -0.079760  -0.057949  -0.618872
 -0.049294  -0.085380  -0.618872
 -0.010305  -0.098048  -0.618872
  0.030465  -0.093763  -0.618872
  0.065968  -0.073265  -0.618872
  0.090065  -0.040099  -0.618872
  0.098588  -0.000000  -0.618872

  0.084164   0.000000  -0.452254
  0.076887   0.034232  -0.452254
  0.056317   0.062546  -0.452254
  0.026008   0.080044  -0.452254
 -0.008798   0.083703  -0.452254
 -0.042082   0.072888  -0.452254
 -0.068090   0.049470  -0.452254
 -0.082325   0.017499  -0.452254
 -0.082325  -0.017499  -0.452254
 -0.068090  -0.049470  -0.452254
 -0.042082  -0.072888  -0.452254
 -0.008798  -0.083703  -0.452254
  0.026008  -0.080045  -0.452254
  0.056317  -0.062546  -0.452254
  0.076887  -0.034233  -0.452254
  0.084164  -0.000000  -0.452254

  0.092386   0.000000  -0.291706
  0.084399   0.037577  -0.291706
  0.061819   0.068656  -0.291706
  0.028549   0.087865  -0.291706
 -0.009657   0.091880  -0.291706
 -0.046193   0.080009  -0.291706
 -0.074742   0.054303  -0.291706
 -0.090368   0.019208  -0.291706
 -0.090368  -0.019208  -0.291706
 -0.074742  -0.054303  -0.291706
 -0.046193  -0.080009  -0.291706
 -0.009657  -0.091880  -0.291706
  0.028549  -0.087865  -0.291706
  0.061819  -0.068656  -0.291706
  0.084399  -0.037577  -0.291706
  0.092386  -0.000000  -0.291706

  0.124988   0.000000  -0.153861
  0.114183   0.050837  -0.153861
  0.083634   0.092885  -0.153861
  0.038624   0.118871  -0.153861
 -0.013065   0.124304  -0.153861
 -0.062494   0.108243  -0.153861
 -0.101118   0.073466  -0.153861
 -0.122257   0.025987  -0.153861
 -0.122257  -0.025987  -0.153861
 -0.101118  -0.073466  -0.153861
 -0.062494  -0.108243  -0.153861
 -0.013065  -0.124304  -0.153861
  0.038624  -0.118871  -0.153861
  0.083634  -0.092885  -0.153861
  0.114183  -0.050837  -0.153861
  0.124988  -0.000000  -0.153861

  0.185015   0.000000  -0.041791
  0.169020   0.075253  -0.041791
  0.123799   0.137493  -0.041791
  0.057173   0.175960  -0.041791
 -0.019339   0.184002  -0.041791
 -0.092508   0.160228  -0.041791
 -0.149681   0.108749  -0.041791
 -0.180972   0.038467  -0.041791
 -0.180972  -0.038467  -0.041791
 -0.149681  -0.108749  -0.041791
 -0.092508  -0.160228  -0.041791
 -0.019339  -0.184002  -0.041791
  0.057173  -0.175960  -0.041791
  0.123799  -0.137493  -0.041791
  0.169020  -0.075253  -0.041791
  0.185015  -0.000000  -0.041791

  0.273264   0.000000   0.053395
  0.249639   0.111146   0.053395
  0.182849   0.203075   0.053395
  0.084443   0.259889   0.053395
 -0.028564   0.271767   0.053395
 -0.136632   0.236653   0.053395
 -0.221075   0.160620   0.053395
 -0.267292   0.056815   0.053395
 -0.267292  -0.056815   0.053395
 -0.221075  -0.160620   0.053395
 -0.136632  -0.236653   0.053395
 -0.028564  -0.271767   0.053395
  0.084443  -0.259889   0.053395
  0.182849  -0.203075   0.053395
  0.249639  -0.111146   0.053395
  0.273264  -0.000000   0.053395

  0.384384   0.000000   0.149114
  0.351152   0.156343   0.149114
  0.257203   0.285653   0.149114
  0.118781   0.365570   0.149114
 -0.040179   0.382278   0.149114
 -0.192192   0.332886   0.149114
 -0.310973   0.225935   0.149114
 -0.375984   0.079918   0.149114
 -0.375984  -0.079918   0.149114
 -0.310973  -0.225935   0.149114
 -0.192192  -0.332886   0.149114
 -0.040179  -0.382278   0.149114
  0.118781  -0.365571   0.149114
  0.257203  -0.285653   0.149114
  0.351152  -0.156343   0.149114
  0.384384  -0.000000   0.149114

  0.504089   0.000000   0.267473
  0.460508   0.205031   0.267473
  0.337301   0.374611   0.267473
  0.155772   0.479417   0.267473
 -0.052692   0.501327   0.267473
 -0.252044   0.436554   0.267473
 -0.407816   0.296296   0.267473
 -0.493073   0.104806   0.267473
 -0.493073  -0.104806   0.267473
 -0.407816  -0.296296   0.267473
 -0.252044  -0.436554   0.267473
 -0.052692  -0.501327   0.267473
  0.155772  -0.479417   0.267473
  0.337301  -0.374611   0.267473
  0.460508  -0.205031   0.267473
  0.504089  -0.000000   0.267473

  0.609609   0.000000   0.430046
  0.556906   0.247950   0.430046
  0.407908   0.453028   0.430046
  0.188380   0.579773   0.430046
 -0.063721   0.606270   0.430046
 -0.304805   0.527937   0.430046
 -0.493184   0.358319   0.430046
 -0.596288   0.126745   0.430046
 -0.596288  -0.126745   0.430046
 -0.493184  -0.358319   0.430046
 -0.304805  -0.527937   0.430046
 -0.063722  -0.606270   0.430046
  0.188380  -0.579773   0.430046
  0.407908  -0.453028   0.430046
  0.556906  -0.247951   0.430046
  0.609609  -0.000000   0.430046

  0.675154   0.000000   0.647779
  0.616784   0.274610   0.647779
  0.451766   0.501737   0.647779
  0.208634   0.642110   0.647779
 -0.070573   0.671455   0.647779
 -0.337577   0.584700   0.647779
 -0.546211   0.396846   0.647779
 -0.660400   0.140372   0.647779
 -0.660400  -0.140372   0.647779
 -0.546211  -0.396845   0.647779
 -0.337577  -0.584700   0.647779
 -0.070573  -0.671455   0.647779
  0.208634  -0.642110   0.647779
  0.451766  -0.501737   0.647779
  0.616784  -0.274610   0.647779
  0.675154  -0.000000   0.647779

  0.681825   0.000000   0.900691
  0.622878   0.277323   0.900691
  0.456230   0.506695   0.900691
  0.210696   0.648454   0.900691
 -0.071270   0.678090   0.900691
 -0.340913   0.590478   0.900691
 -0.551608   0.400767   0.900691
 -0.666926   0.141760   0.900691
 -0.666926  -0.141759   0.900691
 -0.551608  -0.400767   0.900691
 -0.340913  -0.590478   0.900691
 -0.071270  -0.678090   0.900691
  0.210695  -0.648454   0.900691
  0.456230  -0.506695   0.900691
  0.622878  -0.277324   0.900691
  0.681825  -0.000000   0.900691

  0.626000   0.000000   1.101000
  0.571879   0.254617   1.101000
  0.418876   0.465209   1.101000
  0.193445   0.595361   1.101000
 -0.065435   0.622571   1.101000
 -0.313000   0.542132   1.101000
 -0.506445   0.367954   1.101000
 -0.612320   0.130153   1.101000
 -0.612320  -0.130153   1.101000
 -0.506445  -0.367953   1.101000
 -0.313000  -0.542132   1.101000
 -0.065435  -0.622571   1.101000
  0.193444  -0.595361   1.101000
  0.418876  -0.465209   1.101000
  0.571879  -0.254617   1.101000
  0.626000  -0.000000   1.101000

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































































































































































































































































































































































Deleted r34.1/plot/demo/hidden.demo version [3b23bef846].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# $Id$
#
# $Log$
#
set samples 20
set isosamples 20
set hidden3d
set title "Hidden line removal of explicit surfaces"


set xrange [-3:3]
set yrange [-2:2]
splot 1 / (x*x + y*y + 1)
pause -1 "Hit return to continue (1)"

set xrange [-1:1]
set yrange [-1:1]
splot x*y / (x**2 + y**2 + 0.1)
pause -1 "Hit return to continue (2)"

set view 70,45
set nocontour
set xrange [-3:3]
set yrange [-3:3]
splot sin(x*x + y*y) / (x*x + y*y)
pause -1 "Hit return to continue (3)"

set view 60,30
set xrange [-3:3]
set yrange [-3:3]
splot sin(x) * cos(y)
pause -1 "Hit return to continue (4)"

set view 75,230
set contour
replot
pause -1 "Hit return to continue (5)"

set view 80,30,1,1
set data style lines
set autoscale
splot "glass.dat" using 1
pause -1 "Hit return to continue (6)"

set view 50,
set grid
replot
pause -1 "Hit return to continue (7)"

set nocontour
set nogrid
set nohidden3d
set samples 100
set isosamples 10
set view 60,30,1,1
set xrange [-10:10]
set yrange [-10:10]
set zrange [-10:10]
set auto
set title "" 0,0


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































Deleted r34.1/plot/demo/param.demo version [0fd8bcbb4e].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# $Id: param.demo,v 3.26 92/03/24 22:32:22 woo Exp Locker: woo $
#
#
# Show some of the new parametric capabilities.
#
set parametric
set dummy t
set autoscale
set samples 160
set title ""
plot t,sin(t)/t title "t,sin(t)/t or sin(x)/x"
pause -1 "Hit return to continue"

plot sin(t)/t,t
pause -1 "Hit return to continue"

plot sin(t),cos(t)
pause -1 "Hit return to continue"

set xrange [-3:3]
set yrange [-3:3]
set title "Parametric Conic Sections"
plot -t,t,cos(t),cos(2*t),2*cos(t),sin(t),-cosh(t),sinh(t)
set title ""
pause -1 "Hit return to continue"

set xrange [-5:5]
set yrange [-5:5]
plot tan(t),t,t,tan(t)
pause -1 "Hit return to continue"

set trange [-3:3]
plot t,log(t),-t,log(t),sin(t),t**2
pause -1 "Hit return to continue"

set autoscale x
set yrange [-1.5:1.5]
set trange [0:10*pi]
plot sin(t)/t,cos(t)/t
pause -1 "Hit return to continue"

# undo what we've done above
set noparametric
set samples 160
set autoscale xy
set title ""
set offset 0,0,0,0
set key
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































































































Deleted r34.1/plot/demo/polar.dat version [bafb192802].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# $Id: polar.dat,v 3.26 92/03/24 22:32:34 woo Exp Locker: woo $
#
# Input data ncmain.d4 generated by genpat2.f:Tx antenna pattern
# x,y,z of center point B in coord 3
#     -5.12000     0.00000    -1.50000  
# euler matrix
#      0.00000    -1.00000     0.00000  
#      0.70710     0.00000     0.70710  
#     -0.70710     0.00000     0.70710  
#  theta(deg)    phi(deg)  E-theta(dB)  phase     E-phi(dB)    phase
      0.000      0.000   -200.000      0.000     18.992      0.000 
      2.000      0.000   -200.000      0.000     18.898      0.000 
      4.000      0.000   -200.000      0.000     18.619      0.000 
      6.000      0.000   -200.000      0.000     18.152      0.000 
      8.000      0.000   -200.000      0.000     17.497      0.000 
     10.000      0.000   -200.000      0.000     16.651      0.000 
     12.000      0.000   -200.000      0.000     15.614      0.000 
     14.000      0.000   -200.000      0.000     14.382      0.000 
     16.000      0.000   -200.000      0.000     12.952      0.000 
     18.000      0.000   -200.000      0.000     11.320      0.000 
     20.000      0.000   -200.000      0.000      9.483      0.000 
     22.000      0.000   -200.000      0.000      7.434      0.000 
     24.000      0.000   -200.000      0.000      5.169      0.000 
     26.000      0.000   -200.000      0.000      2.680      0.000 
     28.000      0.000   -200.000      0.000     -0.039      0.000 
     30.000      0.000   -200.000      0.000     -2.998      0.000 
     32.000      0.000   -200.000      0.000     -6.204      0.000 
     34.000      0.000   -200.000      0.000     -9.670      0.000 
     36.000      0.000   -200.000      0.000    -13.407      0.000 
     38.000      0.000   -200.000      0.000    -17.429      0.000 
     40.000      0.000   -200.000      0.000    -21.751      0.000 
     42.000      0.000   -200.000      0.000    -26.391      0.000 
     44.000      0.000   -200.000      0.000    -31.368      0.000 
     46.000      0.000   -200.000      0.000    -36.705      0.000 
     48.000      0.000   -200.000      0.000    -42.429      0.000 
     50.000      0.000   -200.000      0.000    -48.569      0.000 
     52.000      0.000   -200.000      0.000    -55.160      0.000 
     54.000      0.000   -200.000      0.000    -62.243      0.000 
     56.000      0.000   -200.000      0.000    -69.867      0.000 
     58.000      0.000   -200.000      0.000    -78.087      0.000 
     60.000      0.000   -200.000      0.000    -86.971      0.000 
     62.000      0.000   -200.000      0.000    -96.602      0.000 
     64.000      0.000   -200.000      0.000   -107.080      0.000 
     66.000      0.000   -200.000      0.000   -118.530      0.000 
     68.000      0.000   -200.000      0.000   -131.110      0.000 
     70.000      0.000   -200.000      0.000   -145.022      0.000 
     72.000      0.000   -200.000      0.000   -160.534      0.000 
     74.000      0.000   -200.000      0.000   -177.982      0.000 
     76.000      0.000   -200.000      0.000   -195.848      0.000 
     78.000      0.000   -200.000      0.000   -199.967      0.000 
     80.000      0.000   -200.000      0.000   -200.000      0.000 
     82.000      0.000   -200.000      0.000   -200.000      0.000 
     84.000      0.000   -200.000      0.000   -200.000      0.000 
     86.000      0.000   -200.000      0.000   -200.000      0.000 
     88.000      0.000   -200.000      0.000   -200.000      0.000 
     90.000      0.000   -200.000      0.000   -200.000      0.000 
     92.000      0.000   -200.000      0.000   -200.000      0.000 
     94.000      0.000   -200.000      0.000   -200.000      0.000 
     96.000      0.000   -200.000      0.000   -200.000      0.000 
     98.000      0.000   -200.000      0.000   -200.000      0.000 
    100.000      0.000   -200.000      0.000   -200.000      0.000 
    102.000      0.000   -200.000      0.000   -200.000      0.000 
    104.000      0.000   -200.000      0.000   -200.000      0.000 
    106.000      0.000   -200.000      0.000   -200.000      0.000 
    108.000      0.000   -200.000      0.000   -200.000      0.000 
    110.000      0.000   -200.000      0.000   -200.000      0.000 
    112.000      0.000   -200.000      0.000   -200.000      0.000 
    114.000      0.000   -200.000      0.000   -200.000      0.000 
    116.000      0.000   -200.000      0.000   -200.000      0.000 
    118.000      0.000   -200.000      0.000   -200.000      0.000 
    120.000      0.000   -200.000      0.000   -200.000      0.000 
    122.000      0.000   -200.000      0.000   -200.000      0.000 
    124.000      0.000   -200.000      0.000   -200.000      0.000 
    126.000      0.000   -200.000      0.000   -200.000      0.000 
    128.000      0.000   -200.000      0.000   -200.000      0.000 
    130.000      0.000   -200.000      0.000   -200.000      0.000 
    132.000      0.000   -200.000      0.000   -200.000      0.000 
    134.000      0.000   -200.000      0.000   -200.000      0.000 
    136.000      0.000   -200.000      0.000   -200.000      0.000 
    138.000      0.000   -200.000      0.000   -200.000      0.000 
    140.000      0.000   -200.000      0.000   -200.000      0.000 
    142.000      0.000   -200.000      0.000   -200.000      0.000 
    144.000      0.000   -200.000      0.000   -200.000      0.000 
    146.000      0.000   -200.000      0.000   -200.000      0.000 
    148.000      0.000   -200.000      0.000   -200.000      0.000 
    150.000      0.000   -200.000      0.000   -200.000      0.000 
    152.000      0.000   -200.000      0.000   -200.000      0.000 
    154.000      0.000   -200.000      0.000   -200.000      0.000 
    156.000      0.000   -200.000      0.000   -200.000      0.000 
    158.000      0.000   -200.000      0.000   -200.000      0.000 
    160.000      0.000   -200.000      0.000   -200.000      0.000 
    162.000      0.000   -200.000      0.000   -200.000      0.000 
    164.000      0.000   -200.000      0.000   -200.000      0.000 
    166.000      0.000   -200.000      0.000   -200.000      0.000 
    168.000      0.000   -200.000      0.000   -200.000      0.000 
    170.000      0.000   -200.000      0.000   -200.000      0.000 
    172.000      0.000   -200.000      0.000   -200.000      0.000 
    174.000      0.000   -200.000      0.000   -200.000      0.000 
    176.000      0.000   -200.000      0.000   -200.000      0.000 
    178.000      0.000   -200.000      0.000   -200.000      0.000 
    180.000      0.000   -200.000      0.000   -200.000      0.000 
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































Deleted r34.1/plot/demo/polar.demo version [5560d98d11].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# $Id: polar.demo,v 3.26 92/03/24 22:32:23 woo Exp Locker: woo $
#
#
# Show some of the new polar capabilities.
#
set polar
set dummy x
set samples 160
set xrange [0:2*pi]
set title "Three circles (with aspect ratio distortion)"
plot .5,1,1.5
pause -1 "Hit return to continue"
set title ""

plot cos(2*x)
pause -1 "Hit return to continue"

plot 2*sqrt(cos(x)),-2*sqrt(cos(x))
pause -1 "Hit return to continue"

set offset pi/4,pi/4,0,0
plot sin(4*x),cos(4*x)
set offset 0,0,0,0
pause -1 "Hit return to continue"

set yrange [-5:5]
plot x/cos(3*x)
pause -1 "Hit return to continue"
set autoscale

plot 1-sin(x)
pause -1 "Hit return to continue"

set xrange [0:12*pi]
plot 2*x
pause -1 "Hit return to continue"

butterfly(x)=exp(cos(x))-2*cos(4*x)+sin(x/12)**5
set samples 800
pause 0 "This is a big one (many samples), be patient..."
set title "Butterfly"
set nokey
plot butterfly(x)
pause -1 "Hit return to continue"

# undo what we've done above
set nopolar
set samples 160
set autoscale xy
set title ""
set offset 0,0,0,0
set key
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































Deleted r34.1/plot/demo/poldat.demo version [1b601fc75b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# $Id: poldat.demo,v 3.26 92/03/24 22:32:33 woo Exp Locker: woo $
#
set samples 361
set size .757,1.0
set time
set title "Antenna Pattern"
set xlabel "Azimuth"
set ylabel "dBSM"
set data style line
set angles degrees
set polar
set yrange [-220:220]
set rrange [-200:60]
plot "polar.dat" using 1:5,"antenna.dat",-150,-100,-50,0
pause -1 "Hit return to continue"

set samples 100
set size 1.0,1.0
set notime
set title "" 0,0
set xlabel "" 0,0
set ylabel "" 0,0
set data style points
set angles radians
set nopolar
set yrange [-10:10]
set rrange [0:10]
set auto
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































Deleted r34.1/plot/demo/simple.demo version [1293b2d87a].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# $Id: simple.demo,v 3.26 92/03/24 22:32:24 woo Exp Locker: woo $
#
#
# Requires data files "[123].dat" from this directory,
# so change current working directory to this directory before running.
# gnuplot> set term <term-type>
# gnuplot> load 'simple.demo'
#
set samples 50
plot [-10:10] sin(x),atan(x),cos(atan(x))
pause -1 "Hit return to continue"

set samples 100 
plot [-pi/2:pi] cos(x),-(sin(x) > sin(x+1) ? sin(x) : sin(x+1))
pause -1 "Hit return to continue"

set samples 200 
plot [-3:5] asin(x),acos(x)
pause -1 "Hit return to continue"

plot [-30:20] besj0(x)*0.12e1 with impulses, (x**besj0(x))-2.5 with points
pause -1 "Hit return to continue"

set samples 400
plot [-10:10] real(sin(x)**besj0(x))
pause -1 "Hit return to continue"

plot [-5*pi:5*pi] [-5:5] real(tan(x)/atan(x)), 1/x
pause -1 "Hit return to continue"

set autoscale
set samples 800
plot [-30:20] sin(x*20)*atan(x)
pause -1 "Hit return to continue"

plot [-19:19] '1.dat'with impulses ,'2.dat' ,'3.dat' with lines
pause -1 "Hit return to continue"

# undo what we have done above
set samples 160
set xrange [-10:10]
set autoscale xy
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































Deleted r34.1/plot/demo/surface1.demo version [c2b9cafc35].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# $Id: surface1.demo,v 3.26 92/03/24 22:32:25 woo Exp Locker: woo $
#
set samples 21
set isosample 11
set xlabel "X axis" -3,-2
set ylabel "Y axis" 3,-2
set zlabel "Z axis" -5
set title "3D gnu plot demo"
set label 1 "This is the surface boundary" at -20,-5,210
set arrow 1 from -10,-5,220 to -10,0,0 nohead
set arrow 2 from -10,-5,220 to 10,0,0 nohead
set arrow 3 from -10,-5,220 to 0,10,0 nohead
set arrow 4 from -10,-5,220 to 0,-10,0 nohead
splot x*y
pause -1 "Hit return to continue (1)"
set noarrow
set nolabel
set grid
splot x**2+y**2, x**2-y**2
pause -1 "Hit return to continue (2)"
rep x*y
pause -1 "Hit return to continue (3)"
rep (x**3+y**3)/10
pause -1 "Hit return to continue (4)"
set ticslevel 0.0
set title "3D gnu plot demo ( ticslevel = 0.0 )"
rep
pause -1 "Hit return to continue (5)"
set ticslevel 2.0
set title "3D gnu plot demo ( ticslevel = 2.0 )"
rep
pause -1 "Hit return to continue (6)"
set ticslevel 0.5
set title "3D gnu plot demo ( ticslevel = 0.5 )"
rep
pause -1 "Hit return to continue (7)"
set title "3D gnu plot demo"
set nogrid
splot x*y with points
pause -1 "Hit return to continue (8)"
set noxtics
set noytics
set xrange [-1:1]
set yrange [-1:1]
set title "Surfaces with no grid or tics"
splot x*y with lines, x**2*y**3 with dots, x**3*y*2 with points
pause -1 "Hit return to continue (9)"
set xtics ("low" -3, "mid" 0, "high" 3)
set ytics -2,0.5,2
set xrange [-3:3]
set yrange [-3:3]
set log z
set title "Surfaces with z log scale"
splot x**2*y**2 + 2, x**2*y**4 + 2, x**4*y**2 + 2
pause -1 "Hit return to continue (10)"
set nolog z
set xtics
set ytics
set xrange [-1:1]
set yrange [-1:1]
set samples 51
set isosample 21
set dummy u,v
set title "3D gnu plot demo"
splot u*v / (u**2 + v**2 + 0.1)
pause -1 "Hit return to continue (11)"
splot [x=-3:3] [y=-3:3] sin(x) * cos(y)
pause -1 "Hit return to continue (12)"
set zrange [-0.35:0.35]
replot
pause -1 "Hit return to continue (13)"
set title "Sinc function"
set label 1 "This is equal to 1" at -5,-2,0.75 right
set arrow 1 from -5,-2.1,0.75 to 0,0,1
sinc(u,v) = sin(sqrt(u**2+v**2)) / sqrt(u**2+v**2)
splot [-5:5.01] [-5:5.01] sinc(u,v)
pause -1 "Hit return to continue (14)"
set view 70,20,1
set zrange [-0.5:1.0]
set ztics -1,0.25,1
set label 1 "This is equal to 1" at -5,-2,1.5 centre
set arrow 1 from -5,-2.1,1.4 to 0,0,1
splot [-12:12.01] [-12:12.01] sinc(u,v)
pause -1 "Hit return to continue (15)"
set noarrow
set ztics
set nolabel
set log
set auto
set title "This has logarithmic scale"
splot [x=1:15] [y=1:15] x**2+y**2
pause -1 "Hit return to continue (16)"
set nolog
set xrange [0:15]
set yrange [0:15]
set auto
set zrange [-0.6:0.6]
set data style lines
set title "Data grid plotting"
set parametric
splot "glass.dat"
pause -1 "Hit return to continue (17)"
splot "glass.dat" using 3:2:1
pause -1 "Hit return to continue (18)"
set zrange [-1.2:1.2]
set noparametric
splot "glass.dat" using 1, "glass.dat" using 2, "glass.dat" using 3
pause -1 "Hit return to continue (19)"

#
# Clean up:
#
set samples 100
set isosamples 10
set view 60,30,1,1
set xrange [-10:10]
set yrange [-10:10]
set zrange [-10:10]
set auto
set title "" 0,0
set xlabel "" 0,0
set ylabel "" 0,0
set zlabel "" 0,0
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































































































































Deleted r34.1/plot/demo/surface2.demo version [81d77499dc].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# $Id: surface2.demo,v 3.26 92/03/24 22:32:26 woo Exp Locker: woo $
#
set parametric
set samples 50

set title "Parametric Sphere"
set urange [-pi/2:pi/2]
set vrange [0:2*pi]
set zrange [-1:1]
set ztics -1.0,0.25,1.0
set view ,,,2.5
splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
pause -1 "Hit return to continue (1)"

set view ,,,0.8
replot
pause -1 "Hit return to continue (2)"

set view ,,,1.6
replot
pause -1 "Hit return to continue (3)"

set view ,,,1.0

set title "Parametric Torus"
set urange [0:2*pi]
set vrange [0:2*pi]
splot (1-0.2*cos(v))*cos(u),(1-0.2*cos(v))*sin(u),0.2*sin(v)
pause -1 "Hit return to continue (4)"

set title "Parametric Hexagon"
set urange [-1.3:1.3]
set vrange [0:2*pi]
set zrange [-0.6:0.6]
set ztics
splot cos(v)**3*cos(u)**3,sin(v)**3*cos(u)**3,sin(u)**3
pause -1 "Hit return to continue (5)"

set title "Parametric Helix"
set samples 100
set urange [0:10*pi]
set vrange [0:2*pi]
set zrange [-0.6:0.6]
splot (1-0.1*cos(v))*cos(u),(1-0.1*cos(v))*sin(u),0.1*(sin(v)+u/1.7-10)
pause -1 "Hit return to continue (6)"

set title "Parametric Shell"
set samples 40
set view 50,30,1.0
set urange [0:2*pi]
set vrange [0:2*pi]
set zrange [-3:1.5]
splot cos(u)*u*(1+cos(v)/2),sin(v)*u/2,sin(u)*u*(1+cos(v)/2)
pause -1 "Hit return to continue (7)"

#
# Clean up:
#
set noparametric
set dummy x,y
set samples 100
set view 60,30,1,1
set urange [-5:5]
set vrange [-5:5]
set zrange [-10:10]
set auto
set title "" 0,0
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































Deleted r34.1/plot/demo/using.dat version [e0efbaed7b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#
# $Id: using.dat,v 3.26 92/03/24 22:32:26 woo Exp Locker: woo $
#
891101 00   1.00  14   8.6  94.0
891101 01   1.04  10  17.5  94.4
891101 02   1.08   9   9.7  97.1
891101 03   1.13   9  10.1  94.3
891101 04   1.17   9   5.7  98.3
891101 05   1.21   8   8.1  99.7
891101 06   1.25   7   3.2  99.6
891101 07   1.29   6   2.5  99.8
891101 08   1.33  20   2.3  99.4
891101 09   1.38  30   3.5  96.1
891101 10   1.42  37   7.7  96.4
891101 11   1.46  36   9.8  97.4
891101 12   1.50  30   8.8  97.4
891101 13   1.54  32   9.1  96.5
891101 14   1.58  37   6.3  97.0
891101 15   1.63  35   6.1  97.3
891101 16   1.67  41   8.6  97.2
891101 17   1.71  28   7.6  97.3
891101 18   1.75  16   4.3  97.6
891101 19   1.79  21   4.2  97.5
891101 20   1.83  20   5.6  96.9
891101 21   1.88  24   6.6  96.2
891101 22   1.92  19   5.8  97.1
891101 23   1.96  16   7.4  97.1
891102 00   2.00  13   7.4  96.4
891102 01   2.04   8   6.6  95.6
891102 02   2.08   6   7.4  94.1
891102 03   2.13   6   6.4  95.9
891102 04   2.17   7   6.4  95.5
891102 05   2.21   6   6.7  95.5
891102 06   2.25   6   6.3  94.6
891102 07   2.29   7   6.5  93.1
891102 08   2.33  15   6.5  92.8
891102 09   2.38  22   7.2  93.2
891102 10   2.42  31   9.1  93.9
891102 11   2.46  37  11.0  95.6
891102 12   2.50  40   9.8  98.7
891102 13   2.54  45   9.5  97.3
891102 14   2.58  46  11.4  98.5
891102 15   2.63  46  11.9  99.1
891102 16   2.67  43  13.0  98.8
891102 17   2.71  28  14.5  99.1
891102 18   2.75  25  13.4  99.1
891102 19   2.79  24   9.9  99.7
891102 20   2.83  25   8.1  99.5
891102 21   2.88  24  10.3  99.4
891102 22   2.92  24  12.0  98.7
891102 23   2.96  23  18.2  98.7
891103 00   3.00  20  16.8  99.0
891103 01   3.04  16  14.8  99.2
891103 02   3.08  17  15.5  98.0
891103 03   3.13  17  14.4  99.4
891103 04   3.17  16  14.4  99.4
891103 05   3.21  14  11.3  99.4
891103 06   3.25  13   8.0  99.7
891103 07   3.29  13   6.1  99.9
891103 08   3.33  18   6.4  99.8
891103 09   3.38  31   6.5  98.9
891103 10   3.42  39   7.5  99.0
891103 11   3.46  37   9.1  98.8
891103 12   3.50  33   9.0  99.2
891103 13   3.54  40  10.4  98.7
891103 14   3.58  45  12.9  98.3
891103 15   3.63  45  13.8  98.5
891103 16   3.67  37  16.1  98.9
891103 17   3.71  29  16.0  99.3  57
891103 18   3.75  21  17.4  97.9  55
891103 19   3.79  14  14.6  97.7
891103 20   3.83  11  14.3  97.8  57
891103 21   3.88  15  14.7  96.2  59
891103 22   3.92  10  12.8  95.1  57
891103 23   3.96   8  10.2  97.6
891104 00   4.00   6   7.3  98.6
891104 01   4.04   4   4.7  99.8
891104 02   4.08   3   3.4  98.0
891104 03   4.13   4   2.9  99.6
891104 04   4.17   4   2.1  99.8
891104 05   4.21   4  11.7  99.9
891104 06   4.25   4   4.5  99.9
891104 07   4.29   4   1.6  88.4
891104 08   4.33   4   1.3  65.2
891104 09   4.38   7   1.4  71.4
891104 10   4.42   9   1.3  70.7
891104 11   4.46  14   8.1  99.5
891104 12   4.50  12   4.2  75.3
891104 13   4.54  18  10.9  95.3
891104 14   4.58  16   7.1  87.6
891104 15   4.63  18   3.3  98.9
891104 16   4.67  15   3.4  99.6
891104 17   4.71   8   2.4  99.9
891104 18   4.75   8   2.2  99.8
891104 19   4.79  11   2.2  99.7
891104 20   4.83  14   2.3  99.7
891104 21   4.88  13   2.5  99.7
891104 22   4.92  10   3.1  99.8
891104 23   4.96  12   4.5  99.7
891105 00   5.00   9   4.8  99.7
891105 01   5.04   8   4.9  99.8
891105 02   5.08   5   5.7  97.5
891105 03   5.13   5   5.2  97.6
891105 04   5.17   4   3.3  85.9
891105 05   5.21   5   1.2  71.4
891105 06   5.25   5   1.1  61.8
891105 07   5.29   5   1.0  71.8
891105 08   5.33   5   1.0  55.7
891105 09   5.38   6   1.0  62.2
891105 10   5.42   7   1.1  61.9
891105 11   5.46   9   1.4  65.6
891105 12   5.50  14   2.8  99.6
891105 13   5.54  16   2.1  94.0
891105 14   5.58  16   2.2  85.1
891105 15   5.63  17   2.5  99.7
891105 16   5.67  19   2.2  90.8
891105 17   5.71  16   1.5  61.3
891105 18   5.75  12   1.6  71.8
891105 19   5.79  16   2.8  98.3
891105 20   5.83  17   3.3  88.8
891105 21   5.88  18   1.3  56.5
891105 22   5.92  20   0.9  38.8
891105 23   5.96  12   1.1  50.8
891106 00   6.00  10   2.2  68.4
891106 01   6.04   8   1.2  54.4
891106 02   6.08   8   1.6  58.4
891106 03   6.13   7   1.1  52.2
891106 04   6.17   6   1.1  56.4
891106 05   6.21   6   1.2  55.7
891106 06   6.25   6   1.0  46.2
891106 07   6.29   7   0.5   7.2
891106 08   6.33  17   0.7  13.8
891106 09   6.38  31   1.1  41.5
891106 10   6.42  37   1.5  52.7
891106 11   6.46  36   3.1  83.7
891106 12   6.50  29   2.0  70.0
891106 13   6.54  28   1.6  71.4
891106 14   6.58  38   3.1  99.1
891106 15   6.63  39   5.6  98.2
891106 16   6.67  43   5.7  98.7  59
891106 17   6.71  27   5.7  99.4
891106 18   6.75  15   4.3  99.8
891106 19   6.79  17   4.1  99.7
891106 20   6.83  20   2.9  99.3
891106 21   6.88  16   3.1  96.3
891106 22   6.92  16   2.8  86.1
891106 23   6.96  16   3.3  96.5
891107 00   7.00  12   3.2  98.2
891107 01   7.04  12   1.6  77.7
891107 02   7.08  10   3.0  98.7
891107 03   7.13   8   1.7  71.1
891107 04   7.17   8   2.8  81.4
891107 05   7.21   8   5.4  92.4
891107 06   7.25   9   5.3  87.7
891107 07   7.29  11   5.6  94.0
891107 08   7.33  15   2.0  74.0
891107 09   7.38  25   2.7  84.3
891107 10   7.42  32   3.0  92.9
891107 11   7.46  41   5.5  97.4
891107 12   7.50  39   6.5  97.5
891107 13   7.54  31   4.4  95.9
891107 14   7.58  35   7.3  98.6
891107 15   7.63  37   8.3  96.3
891107 16   7.67  34   9.2  97.6
891107 17   7.71  20   7.5  99.3
891107 18   7.75  14   7.1  99.5
891107 19   7.79  15   7.1  99.7
891107 20   7.83  16   4.9  99.7
891107 21   7.88  18   4.3  99.7
891107 22   7.92  15   3.1  99.7
891107 23   7.96  11   3.3  99.6
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































































































































































Deleted r34.1/plot/demo/using.demo version [0e0943b98c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# $Id: using.demo,v 3.26 92/03/24 22:32:27 woo Exp Locker: woo $
#
#
# Requires data file "using.dat" from this directory,
# so change current working directory to this directory before running.
#
set title "Convex     November 1-7 1989"
set label "(Weekend)" at 5,25 center
plot 'using.dat' using 3:4 title "Logged in" with impulses,\
     'using.dat' using 3:5 t "Load average" with points,\
     'using.dat' using 3:6 t "%CPU used" with lines
set nolabel
pause -1 "Hit return to continue"

set title "Convex     November 1-7 1989    Circadian"
set xrange[-1:24]
plot 'using.dat' using 2:4 title "Logged in" with impulses,\
     'using.dat' using 2:4 title "Logged in" with points
pause -1 "Hit return to continue"

# undo what we have done above
set title
set autoscale x
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































Deleted r34.1/plot/demo/world.cor version [c0ae53b769].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# $Id: world.cor,v 3.26 92/03/24 22:32:28 woo Exp Locker: woo $
#
# Gnuplot world correspondences.  Feel free to check for and update
# your site; especially if it represents a new location or you
# know more precise coordinates for a site.  A (?) indicates
# the site may not be correct.  Currently coordinates are generally
# rounded to the nearest latitude and longitude.  It's fine, however,
# to give as many decimal places with each as you like.

# USA
# Carnegie Mellon University
# Univ. of Calif. at Irvine
# University of Maryland
-110 35        # Northern Arizona University, Flagstaff, Arizona
-111 32        # Univ. of Arizona, Tucson, Arizona
-110 43        # University of Utah, Salt Lake City, Utah
-118 34        # California Institute of Technology (CALTECH), L.A., Calif.
-118 34        # Claremont, California
-118 34        # Univ. of Calif. at Los Angeles (UCLA), California
-120 34.5      # Univ. of Calif. at Santa Barbara, California
-122 37.5      # Stanford, California
-122 38        # Berkeley, California
-122 38        # Richmond, California
-122 47.5      # University of Washington, Washington
-71 42.5       # MIT, Cambridge, Massachusetts
-74.5 40.5     # New Brunswick, New Jersey
-75 41         # Bethlehem, Pennsylvania
-76 42         # Cornell College, Ithica, New York
-78.5 38       # Univ of Virginia, Charlottesville, Virginia
-79 36         # N.C. State University, Chapel Hill, North Carolina
-80 35         # Duke University, Durham, North Carolina
-81 28         # Melbourne, Florida
-83 40         # Ohio State, Columbus, Ohio
-83 42         # Detroit, Michigan
-84 34         # Alpharetta, Georgia
-84 34         # Atlanta, Georgia
-84 42         # Univ. of Michigan, Ann Arbor, Michigan
-86 39         # UCS Indiana (?)
-88 40         # University of Illinois, Urbana-Champaign, Illinois
-88 42         # Arlington Heights, Illinois
-88 42         # Northwestern University, Evanston, Illinois
-92 30         # Lafayette, Louisiana
-93 45         # Eagan, Minnesota
-95 30         # Houston, Texas
-95 39         # Kansas State University
-96 31         # Texas A&M, College Station, Texas
-98 30         # Univ of Texas, Austin, Texas
# Canada
-123 49        # BC Hydro, Vancover, British Columbia  (?)
-63 45         # Dartmouth, Nova Scotia, Canada
-75 45         # Ecole Polytechnique de Montreal, Canada
# United Kingdom
-8 54.5        # Bangor, United Kingdom
-80.5 43.5     # Waterloo, Ontario, Canada
0 52           # Cambridge, U. K.
# Italy
14 46          # Trieste, Italy
# Australia
138.5666 -35.01666      # Flinders University, Adelaide, South Australia
138.6333 -34.8          # South Australian Institute, Adelaide, South AUS
145.1333 -37.9167       # Monash University, Melbourne, Victoria
144.9833 -37.8167       # Melbourne University, Melbourne, Victoria
# Namibia
17 -23         # Windhoek, Namibia
# Sweden
18 60          # Stockholm, Sweden
# France
2 49           # Valbonne, CEDEX, France  (?)
# Finland
24 60          # Espoo, Finland
24 62          # Wassau, Finland (?)
# Belgium
4.5 51         # Brussels, Belgium
# The Netherlands
4.5 52         # Delft, The Netherlands
# Germany
7 51           # University of Cologne, Federal Republic of Germany
7 51.5         # Fraunhofer Institut, Duisburg, Germany
8 48           # Freiburg im Br.  (Federal Republic of Germany)
8 52           # Univesity of Dortmund, Federal Republic of Germany
11.5 48        # Technische Universitaet Muenchen, Munich, Germany
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































Deleted r34.1/plot/demo/world.dat version [927ae14485].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
#
# $Id: world.dat,v 3.26 92/03/24 22:32:29 woo Exp Locker: woo $
#
-140.37  60.25
-132.08  57.20
-131.46  55.98
-133.84  57.12
-136.01  59.12
-137.12  58.28
-139.98  59.73
-146.54  60.36
-149.90  59.50
-149.18  60.81
-153.53  59.32
-156.52  57.11
-162.34  55.06
-157.85  58.12
-162.06  58.36
-164.58  60.06
-165.29  62.57
-161.12  64.49
-168.23  65.49
-162.99  65.97
-161.56  66.55
-166.64  68.25
-159.53  70.38
-154.37  70.96
-148.09  70.26
-142.49  69.83
-141.21  69.56 

-152.62  58.41
-152.60  58.40 

-153.30  57.80
-152.40  57.48
-153.32  57.79 

-166.96  53.96
-167.01  53.95 

-168.36  53.50
-168.19  53.36 

-170.73  52.68
-170.60  52.55 

-174.47  51.94
-174.47  51.92 

-176.58  51.71
-176.64  51.73 

-177.55  51.76
-177.41  51.63 

-178.27  51.75 

177.35  51.80
177.33  51.76 

172.44  53.00
172.55  53.03 

-141.21  60.16
-133.38  58.93
-130.88  54.83
-128.86  53.90
-126.58  52.12
-127.08  50.80
-124.42  49.66
-122.56  48.91 

-92.32  48.24
-88.13  48.92
-83.11  46.27
-81.66  44.76
-82.09  42.29
-77.10  44.00
-69.95  46.92
-65.92  45.32
-66.37  44.25
-61.22  45.43
-64.94  47.34
-64.12  48.52
-70.68  47.02
-67.24  49.33
-59.82  50.48
-56.14  52.46
-59.07  53.58
-58.26  54.21
-60.69  55.33
-61.97  57.41
-64.35  59.49
-67.29  58.15
-69.89  59.91
-71.31  61.45
-78.22  61.97
-77.28  59.53
-77.09  55.88
-79.06  51.68
-82.23  52.70
-86.75  55.72
-92.17  56.86
-95.61  58.82
-92.66  62.02
-90.65  63.24
-95.96  64.12
-89.88  63.98
-89.30  65.22
-86.86  66.12
-84.54  66.88
-82.30  67.76
-83.10  69.68
-86.05  67.98
-88.18  68.20
-91.00  68.82
-91.72  69.69
-93.15  71.09
-96.58  71.05
-93.35  69.52
-94.23  68.25
-95.96  66.73
-98.83  68.27
-102.45  67.69
-108.34  68.43
-105.83  68.05
-108.15  66.60
-111.15  67.63
-114.10  68.23
-120.92  69.44
-124.32  69.26
-128.76  70.50
-131.86  69.19
-131.15  69.79
-135.81  69.13
-140.19  69.37
-141.20  69.58 

-123.40  48.33
-128.00  50.84
-123.50  48.34 

-132.49  52.88
-132.44  52.91 

-132.64  53.02
-131.97  53.71
-132.63  53.02 

-55.36  51.56
-54.66  49.52
-53.65  47.48
-52.98  46.31
-56.12  46.84
-58.47  47.57
-57.61  50.38
-55.39  51.53 

-61.37  49.01
-61.80  49.29
-61.38  49.03 

-63.01  46.71
-64.42  46.61
-63.04  46.68 

-60.14  46.48
-60.14  46.50 

-122.44  48.92
-124.42  47.18
-124.52  42.48
-123.09  38.45
-121.73  36.62
-117.60  33.34
-117.28  32.64 

-97.62  25.82
-95.62  28.84
-90.77  29.03
-87.33  30.22
-82.69  28.15
-80.16  26.66
-80.74  32.31
-76.89  35.43
-76.47  38.21
-75.66  37.67
-71.31  41.76
-69.44  44.17
-67.69  47.03
-73.18  45.14
-79.26  43.28
-82.84  42.59
-83.49  45.32
-86.36  43.65
-87.75  43.42
-86.01  45.96
-87.00  46.59
-91.39  46.79
-90.05  47.96 

-71.97  41.11
-71.97  41.15 

-80.79  27.03
-81.01  26.99 

-113.01  42.09
-113.10  42.01 

-155.74  20.02
-155.73  19.98 

-156.51  20.78
-156.51  20.78 

-157.12  21.21
-157.08  20.95 

-157.87  21.42 

-159.53  22.07 

-117.44  66.46
-119.59  65.24
-123.95  65.03
-123.69  66.44
-119.21  66.22
-117.44  66.44 

-120.71  64.03
-114.91  62.30
-109.07  62.72
-112.62  61.19
-118.68  61.19
-117.01  61.17
-115.97  62.56
-119.46  64.00
-120.59  63.94 

-112.31  58.46
-108.90  59.44
-104.14  58.90
-102.56  56.72
-101.82  58.73
-104.65  58.91
-111.00  58.51
-112.35  58.62 

-98.74  50.09
-99.75  52.24
-99.62  51.47
-98.82  50.39 

-97.02  50.21
-97.50  54.02
-98.69  52.93
-97.19  51.09
-96.98  50.20 

-95.34  49.04
-92.32  50.34
-94.14  49.47
-95.36  48.82 

-80.39  56.16
-79.22  55.94
-80.34  56.08 

-103.56  58.60
-103.60  58.58 

-101.82  58.03
-102.33  58.10
-101.77  58.06 

-101.88  55.79
-97.92  57.15
-101.22  55.85
-101.88  55.74 

-117.29  32.48
-114.75  27.80
-112.53  24.80
-110.55  24.07
-114.23  29.59
-112.58  29.99
-109.57  25.94
-105.61  21.94
-102.09  17.87
-95.75  15.94
-92.21  14.97 

-88.45  17.42
-87.01  21.33
-91.65  18.72
-96.96  20.37
-97.65  25.67 

-92.22  14.71
-86.74  12.06
-83.03   8.65
-79.93   8.74
-77.17   7.94
-81.99   8.97
-83.92  12.70
-86.33  15.80
-88.40  15.92 

-77.61   6.80
-78.70   0.97
-80.75  -4.47
-76.19 -14.57
-70.44 -18.75
-70.68 -26.15
-71.44 -32.03
-73.38 -37.27
-73.06 -42.11
-73.17 -46.09
-73.52 -48.05
-73.67 -51.56
-71.06 -53.88
-69.14 -50.77
-67.51 -46.59
-63.49 -42.80
-62.14 -40.16
-57.12 -36.71
-53.17 -34.15
-51.26 -32.02
-48.16 -25.48
-40.73 -22.32
-38.88 -15.24
-34.60  -7.81
-41.95  -3.42
-48.02  -1.84
-48.44  -1.57
-50.81   0.00
-54.47   5.39
-60.59   8.32
-64.19   9.88
-70.78  10.64
-70.97  11.89
-76.26   8.76
-77.61   6.80 

-69.14 -52.79
-66.16 -55.08
-70.01 -54.88
-70.55 -53.85
-69.31 -52.81 

-59.29 -51.58
-59.35 -51.54 

-58.65 -51.55
-58.55 -51.56 

-84.39  21.44
-73.90  19.73
-79.27  21.18
-83.74  21.80
-84.32  21.42 

-66.96  17.95
-67.05  17.89 

-77.88  17.22
-78.06  16.98 

-74.47  18.08
-69.88  18.99
-71.10  17.76
-74.45  17.86 

-85.28  73.74
-85.79  70.96
-85.13  71.94
-84.74  72.96
-80.61  73.10
-78.45  72.20
-75.44  72.55
-73.89  71.98
-72.56  71.04
-71.49  70.57
-69.78  70.29
-68.12  69.71
-65.91  69.19
-66.92  68.39
-64.08  67.68
-62.50  66.68
-63.07  65.33
-66.11  66.08
-67.48  65.41
-64.05  63.15
-66.58  63.26
-69.04  62.33
-72.22  63.77
-76.88  64.17
-73.25  65.54
-70.09  66.64
-72.05  67.44
-76.32  68.36
-78.34  70.17
-82.12  69.71
-87.64  70.12
-89.68  71.43
-85.28  73.74 

-80.90  76.10
-84.21  76.28
-88.94  76.38
-85.47  77.40
-85.43  77.93
-87.01  78.54
-83.17  78.94
-84.87  79.93
-81.33  79.82
-76.27  80.92
-82.88  80.62
-82.58  81.16
-86.51  81.05
-89.36  81.21
-90.45  81.38
-89.28  81.86
-87.21  82.30
-80.51  82.05
-80.16  82.55
-77.83  82.86
-75.51  83.05
-71.18  82.90
-65.10  82.78
-63.34  81.80
-68.26  81.26
-69.46  80.34
-71.05  79.82
-74.40  79.46
-75.42  79.03
-75.48  78.92
-76.01  78.20
-80.66  77.28
-78.07  76.98
-80.90  76.13 

-92.86  74.13
-92.50  72.70
-94.89  73.16
-92.96  74.14 

-94.80  76.95
-89.68  76.04
-88.52  75.40
-82.36  75.67
-79.39  74.65
-86.15  74.22
-91.70  74.94
-95.60  76.91
-94.87  76.96 

-99.96  73.74
-97.89  72.90
-98.28  71.13
-102.04  72.92
-101.34  73.14
-99.69  73.59 

-107.58  73.25
-104.59  71.02
-101.71  69.56
-104.07  68.62
-106.61  69.12
-114.09  69.05
-113.89  70.12
-115.88  70.32
-116.10  71.32
-117.45  72.48
-113.53  72.44
-109.84  72.24
-106.62  71.71
-107.43  73.04 

-120.96  74.29
-118.37  72.53
-123.06  71.18
-123.40  73.77
-120.93  74.27 

-108.83  76.74
-106.25  75.54
-107.08  74.78
-112.99  74.16
-112.28  74.99
-116.04  75.33
-115.27  76.20
-110.95  75.56
-109.77  76.31
-108.82  76.70 

-115.70  77.46
-118.10  76.30
-121.13  76.37
-116.04  77.28 

-110.01  77.86
-112.36  77.68
-109.96  77.86 

-109.60  78.48
-112.20  78.01
-109.60  78.48 

-97.87  76.61
-99.21  75.31
-100.86  75.60
-99.40  76.26
-97.79  76.60 

-94.72  75.53
-94.66  75.52 

-104.10  79.01
-99.19  77.54
-103.22  78.08
-104.30  78.95 

-93.74  77.52
-93.74  77.52 

-96.88  78.50
-96.91  77.77
-96.94  78.48 

-84.69  65.84
-81.58  63.87
-85.00  62.96
-84.63  65.71 

-81.84  62.75
-82.01  62.63 

-79.88  62.12
-79.88  62.12 

-43.53  59.89
-45.29  60.67
-47.91  60.83
-49.90  62.41
-50.71  64.42
-51.39  64.94
-52.96  66.09
-53.62  67.19
-53.51  67.51
-51.84  68.65
-52.19  70.00
-51.85  71.03
-55.41  71.41
-54.63  72.97
-56.98  74.70
-61.95  76.09
-66.38  75.83
-71.13  77.00
-66.81  77.60
-70.78  77.78
-64.96  79.70
-63.38  81.16
-56.89  82.17
-48.18  82.15
-42.08  82.74
-38.02  83.54
-23.96  82.94
-25.97  81.97
-25.99  80.64
-13.57  80.97
-16.60  80.16
-19.82  78.82
-18.80  77.54
-21.98  76.46
-20.69  75.12
-21.78  74.40
-24.10  73.69
-26.54  73.08
-24.63  72.69
-21.84  71.69
-24.62  71.24
-27.16  70.89
-27.21  70.00
-24.10  69.35
-28.35  68.43
-32.48  68.56
-35.26  66.26
-37.90  65.90
-40.04  65.00
-40.49  64.04
-42.01  63.14
-42.88  61.15
-43.09  60.07
-43.56  59.90 

-16.26  66.41
-15.32  64.29
-20.14  63.47
-21.76  64.21
-21.33  64.97
-23.04  65.62
-21.76  66.26
-18.77  66.12
-16.23  66.35 

  0.56  51.47
 -1.71  54.94
 -3.41  57.52
 -5.42  58.14
 -5.77  55.59
 -3.48  54.82
 -4.68  52.88
 -2.68  51.58
 -3.80  50.08
  1.26  51.14
  0.65  51.41 

 -7.17  54.91
 -9.97  53.47
 -8.52  51.76
 -5.69  54.79
 -7.34  55.25 

 -1.33  60.66
 -1.17  60.38 

 -6.18  58.44
 -6.09  58.36 

 -6.47  57.58
 -6.33  57.54 

 -7.30  57.54 

 -7.46  57.05 

 -6.54  56.94 

 -6.00  55.94 

 -5.09  55.55 

 -4.44  54.38
 -4.30  54.19 

 -8.08  71.02
 -8.21  70.86 

 16.92  79.52
 22.26  78.46
 16.86  76.41
 16.00  77.39
 16.03  77.92
 16.81  79.50 

 14.71  79.40
 16.05  79.12
 14.02  77.80
 13.56  78.46
 12.63  79.26
 14.68  79.40 

 22.01  78.24
 21.86  78.23 

 21.54  77.75
 23.88  77.26
 21.53  77.67
 22.79  77.79 

 23.50  79.97
 28.24  79.54
 20.85  78.94
 19.00  79.34
 21.05  79.88
 23.41  79.96 

 46.98  80.23
 43.13  79.97
 47.18  80.22

 50.43  80.19
 50.55  79.88
 47.77  79.86
 50.45  80.14

 61.79  80.18
 61.79  80.18

 65.08  80.69
 64.27  80.59
 65.13  80.68

 -5.13  35.66
  4.06  36.63
 10.40  37.12
 11.36  33.61
 20.10  30.10
 23.49  32.17
 31.65  30.80
 35.76  23.74
 39.75  14.82
 42.93  11.34
 51.52  11.45
 49.82   6.99
 43.13  -0.62
 39.15  -7.58
 40.37 -13.20
 37.74 -18.17
 35.33 -22.71
 32.84 -28.15
 26.50 -34.39
 19.55 -35.51
 17.50 -30.88
 12.24 -18.75
 13.89 -12.81
 12.05  -5.55
  9.67   0.14
  7.19   3.79
  1.74   5.39
 -4.77   4.59
-12.00   6.75
-15.54  10.98
-16.33  15.50
-16.10  22.29
-12.90  27.12
 -9.52  31.09
 -5.41  35.58

 33.71   0.00
 33.48  -3.42
 33.34  -0.20
 33.71   0.00

 49.30 -12.50
 49.28 -18.79
 43.95 -25.50
 44.37 -20.08
 46.34 -16.31
 47.91 -14.08
 49.30 -12.50

 32.18  30.58
 36.08  35.03
 32.53  36.17
 27.77  36.94
 26.51  39.18
 31.54  40.82
 38.53  40.48
 40.35  43.17
 39.88  46.45
 35.18  44.99
 33.50  44.96
 30.24  45.14
 28.70  41.48
 26.55  39.84
 23.62  39.67
 23.80  37.34
 21.90  36.92
 18.79  42.02
 14.52  44.31
 14.58  42.25
 18.32  39.57
 16.05  39.35
 11.52  42.36
  6.87  43.08
  2.80  41.09
 -1.11  37.14
 -6.24  36.70
 -8.67  39.57
 -6.51  43.13
 -0.84  45.55
 -3.93  48.40
  0.48  49.09
  4.20  51.29
  6.44  52.92
  8.42  55.94
 11.72  55.49
 11.73  53.66
 16.78  54.14
 21.40  56.32
 24.67  57.20
 28.94  59.18
 24.16  59.52
 22.07  62.66
 23.76  65.35
 18.70  62.54
 19.11  59.67
 18.40  58.54
 15.34  55.73
 11.74  58.08
  8.37  57.68
  5.80  59.20
  7.38  60.86
  7.51  61.86
  9.62  62.99
 13.37  65.46
 15.46  67.12
 18.54  68.62
 22.32  69.64
 24.77  70.17
 25.93  69.79
 28.56  70.46
 29.75  69.76
 33.83  69.11
 41.90  66.85
 35.14  66.25
 33.30  66.07
 35.46  64.15
 37.68  64.03
 41.71  64.09
 44.80  65.58
 44.87  68.16
 45.92  66.83
 51.79  67.85
 53.70  67.89
 59.68  68.09
 65.07  69.08
 68.56  69.19
 68.38  70.97
 73.03  71.62
 73.80  68.29
 69.42  66.45
 73.43  66.36
 77.51  68.36
 80.74  66.74
 75.27  68.67
 75.11  71.80
 78.62  70.56
 78.43  71.90
 82.72  71.23
 84.25  70.03
 81.40  72.76
 86.50  74.01
 87.68  74.78
 90.25  75.23

 68.33  76.71
 66.03  75.62
 59.10  74.11
 54.92  73.03
 56.67  74.10
 58.56  75.09
 63.86  75.87
 68.19  76.70

 53.04  72.57
 58.29  70.39
 55.03  70.78
 53.44  72.26
 53.63  72.61

 90.06  21.03
 82.06  15.95
 80.05  11.72
 76.41   8.60
 72.79  17.43
 72.02  20.00
 68.98  21.99
 64.62  24.41
 57.83  24.77
 53.11  26.20
 49.67  29.41
 50.96  25.15
 54.33  23.44
 59.03  22.57
 57.87  18.86
 52.95  15.74
 47.26  12.96
 42.75  14.68
 39.93  19.61
 36.92  25.78
 33.30  28.46
 32.60  30.63

 52.22  46.50
 51.73  44.73
 52.56  41.80
 53.43  40.40
 54.22  37.86
 49.04  38.45
 48.17  42.76
 49.33  45.64
 52.22  46.50

 62.32  46.32
 60.32  43.06
 59.57  45.58
 61.94  46.33

 79.55  46.12
 74.30  44.44
 78.62  45.79
 79.66  46.07

 76.81  41.96
 76.73  41.86

 35.15  35.15
 34.61  34.84
 35.18  35.17

 23.84  35.33
 24.30  34.91
 24.09  35.39

 15.54  37.89
 13.47  37.89
 15.54  37.89

  9.56  40.95
  8.46  39.99
  9.12  40.69

  9.72  42.60
  9.54  42.35

 80.60   8.95
 79.73   5.96
 80.10   8.30

 11.04  57.44
 10.67  57.25

-77.92  24.67
-77.98  24.22

-77.61  23.62
-77.18  23.64

-75.55  24.13
-75.41  24.31

-91.40  -0.17
-91.52  -0.26

-60.25  46.68
-60.71  46.33

-63.89  49.47
-63.45  49.43

142.53 -10.60
145.62 -16.34
149.79 -22.09
153.21 -26.82
150.52 -35.19
145.60 -38.53
140.13 -37.69
137.34 -34.77
135.76 -34.56
131.50 -31.34
121.72 -33.65
115.62 -33.25
114.09 -26.01
114.88 -21.27
122.34 -18.13
125.32 -14.53
128.39 -14.90
132.35 -11.42
136.16 -12.43
138.07 -16.45
142.25 -10.78

144.72 -40.68
148.32 -42.14
145.57 -42.77
146.47 -41.19

172.86 -34.23
176.10 -37.52
177.06 -39.49
174.77 -38.03
172.83 -34.27

172.36 -40.53
172.92 -43.81
168.41 -46.13
170.26 -43.21
173.69 -40.94

150.74 -10.18
143.04  -8.26
138.48  -6.97
131.95  -2.94
130.91  -1.35
134.38  -2.64
141.24  -2.62
148.19  -8.15
150.75 -10.27

117.24   7.01
117.90   0.76
113.89  -3.50
109.44  -0.82
113.13   3.38
117.24   7.01

 95.31   5.75
102.32   1.40
106.03  -2.98
101.46  -2.81
 95.20   5.73

140.91  41.53
140.79  35.75
136.82  34.56
133.56  34.72
132.49  35.41
136.73  37.20
139.82  40.00
140.68  41.43

133.71  34.30
131.41  31.58
129.38  33.10
133.90  34.37

141.89  45.50
144.12  42.92
140.30  41.64
141.53  45.30
141.89  45.53

142.57  54.36
143.64  49.19
141.99  45.88
141.92  50.85
142.60  54.34

121.92  25.48
120.53  24.70
121.70  25.51

110.81  20.07
109.20  19.66
110.81  20.07

106.51  -6.16
114.15  -7.72
108.71  -7.89
106.51  -6.16

164.27 -20.01
164.16 -20.27

178.61 -17.04
178.61 -17.04

179.45 -16.43
179.35 -16.43

-172.55 -13.39
-172.61 -13.78

122.26  18.67
123.05  13.86
120.73  13.80
120.43  16.43
121.72  18.40

125.34   9.79
125.56   6.28
122.38   7.00
125.10   9.38

119.64  11.35
118.81  10.16
119.59  10.86

 90.05  21.74
 94.21  17.79
 97.66  15.36
 98.21   9.17
103.22   1.56
100.26   8.30
100.01  13.52
104.39  10.37
107.32  10.45
107.55  16.34
108.53  21.73
112.69  21.81
118.83  24.93
121.28  30.25
120.73  32.65
121.77  36.90
117.58  38.21
121.62  40.15
125.12  39.08
126.15  35.18
128.33  38.46
129.92  42.04
138.77  47.30
140.72  52.43
137.10  54.07
140.77  58.39
148.57  59.46
153.83  59.10
156.81  61.68
159.90  60.73
163.79  61.73
156.40  57.76
156.42  51.09
161.82  54.88
162.92  57.34
164.48  59.89
170.42  60.17
177.46  62.62
178.20  64.29
179.48  64.88

-179.87  65.14
-177.13  65.63
-173.46  64.74
-171.13  66.38
-176.48  67.78
-178.80  68.42

178.88  69.10
170.20  69.99
167.68  69.63
159.92  70.14
150.77  71.28
146.92  72.21
146.04  72.39
139.60  72.23
135.49  71.51
130.53  70.86
126.10  72.24
128.94  73.02
123.10  73.28
113.34  73.37
110.43  73.71
107.88  73.72
112.99  75.60
106.34  76.40
104.10  77.52
 99.69  76.09
 95.12  75.95
 89.68  75.57

101.96  79.08
101.31  77.86
101.22  79.04

 94.29  79.29
100.02  79.43
 95.31  78.68
 95.44  79.65
 97.26  79.62

 95.46  80.62
 92.39  79.66
 95.07  80.54

 91.39  79.62
 91.33  79.62

138.54  76.05
144.93  75.45
140.30  74.99
137.27  75.44
138.29  75.98

146.08  75.29
147.75  74.73
145.85  75.06

141.44  73.88
141.48  73.84

  0.01 -71.68
  6.57 -70.57
 15.04 -70.44
 25.10 -70.75
 33.37 -69.10
 38.46 -69.77
 42.85 -68.16
 46.59 -67.23
 49.35 -66.96
 52.90 -65.97
 58.46 -67.20
 63.60 -67.58
 70.63 -68.41
 69.24 -70.36
 76.20 -69.44
 88.08 -66.64
 94.98 -66.52
101.53 -66.09
111.31 -65.91
118.64 -66.87
126.24 -66.24
133.09 -66.18
139.85 -66.72
146.86 -67.96
153.65 -68.82
159.94 -69.57
164.10 -70.67
170.19 -71.94
165.68 -74.64
163.82 -77.60
162.10 -78.95
166.72 -82.84
175.58 -83.86

-178.56 -84.37
-147.96 -85.40
-152.96 -81.12
-153.95 -79.50
-151.24 -77.48
-146.74 -76.44
-137.68 -75.16
-131.63 -74.63
-123.05 -74.41
-114.76 -73.97
-111.91 -75.41
-105.05 -74.77
-100.90 -74.21
-101.04 -73.18
-100.28 -73.06
-93.06 -73.33
-85.40 -73.18
-79.82 -73.04
-78.21 -72.52
-71.90 -73.41
-67.51 -71.10
-67.57 -68.92
-66.65 -66.83
-64.30 -65.28
-59.14 -63.74
-59.58 -64.37
-62.50 -65.94
-62.48 -66.66
-65.64 -68.02
-63.85 -69.07
-61.69 -70.87
-60.89 -72.71
-61.07 -74.30
-63.33 -75.88
-76.05 -77.06
-83.04 -77.12
-74.30 -80.83
-56.40 -82.14
-42.46 -81.65
-31.60 -80.17
-34.01 -79.20
-32.48 -77.28
-26.28 -76.18
-17.18 -73.45
-11.20 -72.01
 -8.67 -71.98
 -5.45 -71.45
 -0.82 -71.74
  0.07 -71.68

164.65 -77.89
170.95 -77.37
179.67 -78.25

-178.74 -78.24
-165.76 -78.47
-158.42 -77.73

-58.98 -64.63
-60.99 -68.62
-61.02 -71.70

-62.01 -74.94
-52.00 -77.07
-42.23 -77.80
-36.22 -78.03

-35.03 -77.81
-26.13 -75.54
-19.35 -73.04
-12.16 -71.86
 -6.15 -70.65
 -0.57 -69.14
  4.93 -70.25
 10.91 -69.99
 16.52 -69.87
 25.41 -70.22
 32.13 -69.29
 33.62 -69.58

 70.56 -68.53
 73.91 -69.51

 81.42 -67.87
 84.67 -66.41
 89.07 -66.73

-135.79 -74.67
-124.34 -73.22
-116.65 -74.08
-109.93 -74.64
-105.36 -74.56
-105.83 -74.77

-69.30 -70.06
-71.33 -72.68
-71.42 -71.85
-75.10 -71.46
-71.79 -70.55
-70.34 -69.26
-69.34 -70.13

-49.20 -77.83
-44.59 -78.79
-44.14 -80.13
-59.04 -79.95
-49.28 -77.84
-48.24 -77.81

-58.13 -80.12
-63.25 -80.20
-58.32 -80.12

-163.64 -78.74
-161.20 -79.93
-163.62 -78.74

 66.82  66.82
 66.82  66.82

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/demo/world.demo version [6a2b0a7c34].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# $Id: world.demo,v 3.26 92/03/24 22:32:31 woo Exp Locker: woo $
#
set title "Gnuplot Correspondences"
set nokey
set noborder
set noyzeroaxis
set noxtics
set noytics
#
# plot world map and correspondent locations as a +
plot 'world.dat' with lines 3 4, 'world.cor' with points 1 2
set title ""
set key
set border
set yzeroaxis
set xtics
set ytics
pause -1 "Hit return to continue"
#
# plot a '3D version using spherical coordinate system' of the world.
set angles degrees
set title "3D version using spherical coordinate system"
set view 70,40,,2.0
set mapping spherical
set parametric
set samples 32
set isosamples 9
set urange [-pi/2:pi/2]
set vrange [0:2*pi]
splot 'world.dat' with lines 3 4, 'world.cor' with points 1 2, cos(u)*cos(v),cos(u)*sin(v),sin(u) with lines 5 6
pause -1 "Hit return to continue"
#
# plot a '3D version using cylindrical coordinate system' of the world.
set title "3D version using cylindrical coordinate system"
set view 70,40,,2.0
set mapping cylindrical
set parametric
set samples 32
set isosamples 9
set urange [-pi:pi]
set vrange [-90:90]
splot 'world.dat' with lines 3 4, 'world.cor' with points 1 2, cos(u),sin(u),v with lines 5 6
pause -1 "Hit return to continue"


#
# Clean up:
#
set noparametric
set mapping cartesian
set angles radians
set samples 100
set isosamples 10
set view 60,30,1,1
set xrange [-10:10]
set yrange [-10:10]
set zrange [-10:10]
set auto
set title "" 0,0
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































Deleted r34.1/plot/docs/Makefile version [60c2b500a9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#
# $Id: Makefile,v 3.26 1992/03/25 04:53:29 woo Exp woo $
#
# Makefile for GNUPLOT documentation
#
# Note that the top-level file for documentation is gnuplot.doc.
# See README.
#
# To print manual:
#    make gnuplot.dvi             (for latex)
#    (print or view gnuplot.dvi)
# OR
#    make gnuplot.nroff           (for nroff)
#    (print or view gnuplot.nroff)
#   or
#    make "TROFF=itroff" troff    (for troff; use your troff here)
#
# $Id: Makefile,v 3.26 1992/03/25 04:53:29 woo Exp woo $

# usually overridden by ../Makefile
HELPDEST = /usr/local/lib/

# substitute your troff command (and any flags) for this one
TROFF=troff
  
# substitute cp if you do not have the install program
INSTALL=install

# Compiler flags
# -DSYSV if att sys V
# -DMSDOS if MSDOS PS
# -traditional -g -O if gcc (set 'CC = gcc')
# no extra flags for BSD
CFLAGS = -s
CC = cc

# default is what is needed for interactive gnuplot
default: gnuplot.hlp gnuplot.gih

### [tn]roff documentation
troff: gnuplot.ms titlepage.ms
	tbl gnuplot.ms | eqn | $(TROFF) -ms

nroff gnuplot.nroff: gnuplot.ms titlepage.ms
	tbl gnuplot.ms | neqn | nroff -ms | col > gnuplot.nroff

ms gnuplot.ms: doc2ms gnuplot.doc
	./doc2ms < gnuplot.doc > gnuplot.ms

doc2ms: doc2ms.c
	$(CC) $(CFLAGS) -o doc2ms doc2ms.c

### LaTeX documentation
tex gnuplot.tex: doc2tex gnuplot.doc
	./doc2tex < gnuplot.doc > gnuplot.tex

dvi gnuplot.dvi: gnuplot.tex titlepage.tex
	(latex gnuplot.tex ; latex gnuplot.tex)

doc2tex: doc2tex.c
	$(CC) $(CFLAGS) -o doc2tex doc2tex.c

# this is how to make gnuplot.hlp
hlp gnuplot.hlp: doc2hlp gnuplot.doc
	./doc2hlp < gnuplot.doc > gnuplot.hlp

doc2hlp: doc2hlp.c
	$(CC) $(CFLAGS) -o doc2hlp doc2hlp.c

# this is how to make gnuplot.gih
gih gnuplot.gih: doc2gih gnuplot.doc
	./doc2gih < gnuplot.doc > gnuplot.gih

doc2gih: doc2gih.c
	$(CC) $(CFLAGS) -o doc2gih doc2gih.c

# this is how to check the gnuplot.doc file
check: checkdoc gnuplot.doc
	./checkdoc < gnuplot.doc

checkdoc: checkdoc.c
	$(CC) $(CFLAGS) -o checkdoc checkdoc.c

# For Unix and MSDOS only
install-unix: gnuplot.gih
	$(INSTALL) gnuplot.gih $(HELPDEST)

# for VMS only
install-vms: gnuplot.hlp
	$(INSTALL) gnuplot.hlp $(HELPDEST)

# remove all derived files
clean:
	rm -f doc2ms gnuplot.nroff gnuplot.ms
	rm -f doc2tex gnuplot.tex gnuplot.dvi gnuplot.aux gnuplot.log gnuplot.toc
	rm -f doc2hlp gnuplot.hlp
	rm -f doc2gih gnuplot.gih
	rm -f checkdoc *~ *.o core a.out
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































































Deleted r34.1/plot/docs/Makefile.ami version [542d886298].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# $Id: Makefile.ami,v 3.26 1992/03/25 04:53:29 woo Exp woo $
#
# Makefile for GNUPLOT documentation (Aztec C v5.xx Version)
#
# Note that the top-level file for documentation is gnuplot.doc.
# See README.
#
# To print manual:
#    make gnuplot.dvi             (for latex)
#    (print or view gnuplot.dvi)
# OR
#    make gnuplot.nroff           (for nroff)
#    (print or view gnuplot.nroff)
#   or
#    make "TROFF=itroff" troff    (for troff; use your troff for itroff here)
#
# $Id: Makefile.ami,v 3.26 1992/03/25 04:53:29 woo Exp woo $

# usually overridden by ../Makefile
HELPDEST = /usr/local/lib/

# substitute your troff command (and any flags) for this one
TROFF=itroff
  
# substitute cp if you do not have the install program
INSTALL=install

# Compiler flags
# -DSYSV if att sys V
# -DMSDOS if MSDOS PS
# -traditional -g -O if gcc (set 'CC = gcc')
# no extra flags for BSD
CFLAGS = 
CC = cc
LN =ln
LFLAGS = -lm -lc

# default is what is needed for interactive gnuplot
default: gnuplot.hlp gnuplot.gih

### [tn]roff documentation
troff: gnuplot.ms titlepage.ms
	tbl gnuplot.ms | eqn | $(TROFF) -ms

# for screen viewing, or printers with backspace/overstrike, remove the -Tlpr
nroff gnuplot.nroff: gnuplot.ms titlepage.ms
	tbl gnuplot.ms | neqn | nroff -ms -Tlpr > gnuplot.nroff

ms gnuplot.ms: doc2ms gnuplot.doc
	doc2ms < gnuplot.doc > gnuplot.ms

doc2ms: doc2ms.c
	$(CC) $(CFLAGS) -o doc2ms.o doc2ms.c
	$(LN) -o doc2ms doc2ms.o $(LFLAGS)

### LaTeX documentation
tex gnuplot.tex: doc2tex gnuplot.doc
	doc2tex < gnuplot.doc > gnuplot.tex

dvi gnuplot.dvi: gnuplot.tex titlepage.tex
	latex gnuplot.tex
	latex gnuplot.tex

doc2tex: doc2tex.c
	$(CC) $(CFLAGS) -o doc2tex.o doc2tex.c
	$(LN) -o doc2tex doc2tex.o $(LFLAGS)

# this is how to make gnuplot.hlp
hlp gnuplot.hlp: doc2hlp gnuplot.doc
	doc2hlp < gnuplot.doc > gnuplot.hlp

doc2hlp: doc2hlp.c
	$(CC) $(CFLAGS) -o doc2hlp.o doc2hlp.c
	$(LN) -o doc2hlp doc2hlp.o $(LFLAGS)

# this is how to make gnuplot.gih
gih gnuplot.gih: doc2gih gnuplot.doc
	doc2gih < gnuplot.doc > gnuplot.gih

doc2gih: doc2gih.c
	$(CC) $(CFLAGS) -o doc2gih.o doc2gih.c
	$(LN) -o doc2gih doc2gih.o $(LFLAGS)

# this is how to check the gnuplot.doc file
check: checkdoc gnuplot.doc
	checkdoc < gnuplot.doc

checkdoc: checkdoc.c
	$(CC) $(CFLAGS) -o checkdoc.o checkdoc.c
	$(LN) -o checkdoc checkdoc.o $(LFLAGS)

# For Unix and MSDOS only
install-unix: gnuplot.gih
	$(INSTALL) gnuplot.gih $(HELPDEST)

# for VMS only
install-vms: gnuplot.hlp
	$(INSTALL) gnuplot.hlp $(HELPDEST)

# remove all derived files
clean:
	rm -f doc2ms gnuplot.nroff gnuplot.ms
	rm -f doc2tex gnuplot.tex gnuplot.dvi gnuplot.aux gnuplot.log gnuplot.toc
	rm -f doc2hlp gnuplot.hlp
	rm -f doc2gih gnuplot.gih
	rm -f checkdoc *~ *.o core a.out
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































Deleted r34.1/plot/docs/README version [c366f3b11b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Notes on the gnuplot help files and documentation.

Gnuplot documentation is available in three ways:

1 - interactively, within gnuplot
2 - as a printed document. 
3 - as a manual page, through the Unix man(1) facility

The first two forms describe the inner workings, and contain
equivalent information, while the third form tells how to run gnuplot.

The two first forms above derive their information from the file
gnuplot.doc, which is the MASTER copy of gnuplot help information. All
other forms, except for gnuplot.1, the man page, are derived from it. 

gnuplot.doc -> gnuplot.hlp 
            -> gnuplot.gih
            -> gnuplot.tex
            -> gnuplot.ms
    	   	  	 	    		
On VMS the interactive help is supplied by the system help facility,
using the gnuplot.hlp file. This is made with ('make hlp').  On Unix,
AmigaDOS, and MSDOS the interactive help is built in to the program,
and uses the gnuplot.gih file ('make gih').

The printed document is available in either latex or troff/nroff (ms)
format, using gnuplot.tex or gnuplot.ms, derived from gnuplot.doc with
either doc2tex or doc2ms. Type 'make dvi' or 'make nroff'. For troff,
type 'make ms' and then troff -ms gnuplot.ms in whatever way you use
troff.

If VMS users prefer the gnuplot interactive help facility to the
system facility, this can be easily changed in command.c.


Description of the gnuplot.doc format:
--------------------------------------

Here is an example of the DOC master help format:

?
1 gnuplot
 GNUPLOT is a command-driven interactive function plotting program.  It
 ...
?exit
2 exit
 'exit', 'quit' and ...
?expressions
2 expressions
 In general, any mathematical expression accepted by C, ...

 Topics:
 functions operators
?expressions functions
?functions
3 functions
 The functions in GNUPLOT are ...

 Topics:
 abs acos arg ...
?expressions functions abs
?functions abs
?abs
4 abs
 This function returns the absolute value of its argument.  The
 returned value is of the same type as the argument. 
?expressions functions acos
?functions acos
?acos
4 acos
 This function returns the arc cosine (inverse cosine) of its
 argument.  'acos' returns its argument in radians. 


Some notes about the format:
----------------------------
Remember that all text must be able to be processed by gnuplot, VMS,
 nroff, troff, and latex, and always do something reasonable. 
The first column is reserved for control characters.
Text does not start in the first column.
Lines that start in column 2 may be typeset by LaTeX.
Lines that have a space in column 2 are to be printed in a verbatim
 environment by LaTeX.
Do NOT use tabs in the help file.
Conversion from this format to vax .hlp file involves removal of
 lines starting with [?@#$%] (see doc2hlp). VMS uses the numbers
 to represent a tree. 
Conversion from this format to gnuplot .gih file involves removal of
 lines starting with [0-9@#$%] (see doc2gih). Gnuplot matches your
 help query against the ? lines to find the help information.
 Multiple ? lines for one text block constitute synonyms. The most
 specific should be first, eg 'expressions functions' before 'functions'.
 Spaces are allowed here, but should be single.
Backquote pairs are converted by the doc2tex program into boldface;
 that is, `some text` is converted to {\bf some text}. Be sure to pair
 the backquotes, or the whole document will be boldface!

Control characters in first column:
?    used by .gih format, for builtin interactive help - keyword
0-9  used by VMS help and by doc2{tex,ms} formatters to define level,keyword
@    used by doc2{tex,ms} to define table start/end
#    used by doc2tex: table entry
%    used by doc2ms: table entry
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































Deleted r34.1/plot/docs/checkdoc.c version [644c0fa163].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef lint
static char *RCSid = "$Id: checkdoc.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $";
#endif

/*
 * checkdoc -- check a doc file for correctness of first column. 
 *
 * Prints out lines that have an illegal first character.
 * First character must be space, digit, or ?, @, #, %, 
 * or line must be empty.
 *
 * usage: checkdoc < docfile
 * Modified by Russell Lang from hlp2ms.c by Thomas Williams 
 *
 * Original version by David Kotz used the following one line script!
 * sed -e '/^$/d' -e '/^[ 0-9?@#%]/d' gnuplot.doc
 *
 */

#include <stdio.h>
#include <ctype.h>

#define MAX_LINE_LEN	256
#define TRUE 1
#define FALSE 0

main()
{
	convert(stdin,stdout);
	exit(0);
}

convert(a,b)
	FILE *a,*b;
{
    static char line[MAX_LINE_LEN];

    while (fgets(line,MAX_LINE_LEN,a)) {
	   process_line(line, b);
    }
}

process_line(line, b)
	char *line;
	FILE *b;
{
    switch(line[0]) {		/* control character */
	   case '?': {			/* interactive help entry */
		  break;			/* ignore */
	   }
	   case '@': {			/* start/end table */
		  break;			/* ignore */
	   }
	   case '#': {			/* latex table entry */
		  break;			/* ignore */
	   }
	   case '%': {			/* troff table entry */
		  break;			/* ignore */
	   }
	   case '\n':			/* empty text line */
	   case ' ': {			/* normal text line */
		  break;
	   }
	   default: {
		  if (isdigit(line[0])) { /* start of section */
		  		/* ignore */
		  } else
			fputs(line,b);    /* output bad line */
		  break;
	   }
    }
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































































































































Deleted r34.1/plot/docs/doc2gih version [705eac0100].

cannot compute difference between binary files

Deleted r34.1/plot/docs/doc2gih.c version [62377ad68c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef lint
static char *RCSid = "$Id: doc2gih.c,v 3.26 92/03/25 04:53:29 woo Exp Locker: woo $";
#endif

/*
 * doc2gih.c  -- program to convert Gnuplot .DOC format to gnuplot
 * interactive help (.GIH) format.
 *
 * This involves stripping all lines with a leading digit or
 * a leading @, #, or %.
 * Modified by Russell Lang from hlp2ms.c by Thomas Williams 
 *
 * usage:  doc2gih < file.doc > file.gih
 *
 * Original version by David Kotz used the following one line script!
 * sed '/^[0-9@#%]/d' file.doc > file.gih
 */

#include <stdio.h>
#include <ctype.h>

#define MAX_LINE_LEN	256
#define TRUE 1
#define FALSE 0

main(argc,argv)
int argc;
char **argv;
{
FILE * infile;
FILE * outfile;
	infile = stdin;
	outfile = stdout;
	if (argc > 3) {
		fprintf(stderr,"Usage: %s infile outfile\n", argv[0]);
		exit(1);
	}
	if (argc >= 2) 
		if ( (infile = fopen(argv[1],"r")) == (FILE *)NULL) {
			fprintf(stderr,"%s: Can't open %s for reading\n",
				argv[0], argv[1]);
			exit(1);
		}
	if (argc == 3)
		if ( (outfile = fopen(argv[2],"w")) == (FILE *)NULL) {
			fprintf(stderr,"%s: Can't open %s for writing\n",
				argv[0], argv[2]);
		}
	
	convert(infile,outfile);
	exit(0);
}


convert(a,b)
	FILE *a,*b;
{
    static char line[MAX_LINE_LEN];

    while (fgets(line,MAX_LINE_LEN,a)) {
	   process_line(line, b);
    }
}

process_line(line, b)
	char *line;
	FILE *b;
{
    static int line_count = 0;

    line_count++;

    switch(line[0]) {		/* control character */
	   case '?': {			/* interactive help entry */
		  (void) fputs(line,b); 
		  break;		
	   }
	   case '@': {			/* start/end table */
		  break;			/* ignore */
	   }
	   case '#': {			/* latex table entry */
		  break;			/* ignore */
	   }
	   case '%': {			/* troff table entry */
		  break;			/* ignore */
	   }
	   case '\n':			/* empty text line */
	   case ' ': {			/* normal text line */
		  (void) fputs(line,b); 
		  break;
	   }
	   default: {
		  if (isdigit(line[0])) { /* start of section */
		  		/* ignore */
		  } else
		    fprintf(stderr, "unknown control code '%c' in column 1, line %d\n",
			    line[0], line_count);
		  break;
	   }
    }
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































Deleted r34.1/plot/docs/doc2hlp version [d4bb435422].

cannot compute difference between binary files

Deleted r34.1/plot/docs/doc2hlp.c version [208895ee16].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef lint
static char *RCSid = "$Id: doc2hlp.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $";
#endif

/*
 * doc2hlp.c  -- program to convert Gnuplot .DOC format to 
 * VMS help (.HLP) format.
 *
 * This involves stripping all lines with a leading ?,
 * @, #, or %.
 * Modified by Russell Lang from hlp2ms.c by Thomas Williams 
 *
 * usage:  doc2hlp < file.doc > file.hlp
 *
 * Original version by David Kotz used the following one line script!
 * sed '/^[?@#%]/d' file.doc > file.hlp
 */

#include <stdio.h>
#include <ctype.h>

#define MAX_LINE_LEN	256
#define TRUE 1
#define FALSE 0

main()
{
	convert(stdin,stdout);
	exit(0);
}


convert(a,b)
	FILE *a,*b;
{
    static char line[MAX_LINE_LEN];

    while (fgets(line,MAX_LINE_LEN,a)) {
	   process_line(line, b);
    }
}

process_line(line, b)
	char *line;
	FILE *b;
{
    static int line_count = 0;

    line_count++;

    switch(line[0]) {		/* control character */
	   case '?': {			/* interactive help entry */
		  break;			/* ignore */
	   }
	   case '@': {			/* start/end table */
		  break;			/* ignore */
	   }
	   case '#': {			/* latex table entry */
		  break;			/* ignore */
	   }
	   case '%': {			/* troff table entry */
		  break;			/* ignore */
	   }
	   case '\n':			/* empty text line */
	   case ' ': {			/* normal text line */
		  (void) fputs(line,b); 
		  break;
	   }
	   default: {
		  if (isdigit(line[0])) { /* start of section */
			(void) fputs(line,b); 
		  } else
		    fprintf(stderr, "unknown control code '%c' in column 1, line %d\n", 
				  line[0], line_count);
		  break;
	   }
    }
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































Deleted r34.1/plot/docs/doc2hlp.com version [4ce9625fe6].

1
2
3
$ def/user sys$input [.docs]gnuplot.doc
$ def/user sys$output []gnuplot.hlp
$ run doc2hlp
<
<
<






Deleted r34.1/plot/docs/doc2ms.c version [eb541958c0].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#ifndef lint
static char *RCSid = "$Id: doc2ms.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $";
#endif

/*
 * doc2ms.c  -- program to convert Gnuplot .DOC format to *roff -ms document
 * From hlp2ms by Thomas Williams 
 *
 * Modified by Russell Lang, 2nd October 1989
 * to make vms help level 1 and 2 create the same ms section level.
 *
 * Modified to become doc2ms by David Kotz (David.Kotz@Dartmouth.edu) 12/89
 * Added table and backquote support.
 *
 * usage:  doc2ms < file.doc > file.ms
 *
 *   where file.doc is a VMS .DOC file, and file.ms will be a [nt]roff
 *     document suitable for printing with nroff -ms or troff -ms
 *
 * typical usage for GNUPLOT:
 *
 *   doc2ms < gnuplot.doc | troff -ms
 */

static char rcsid[] = "$Id: doc2ms.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $";

#include <stdio.h>
#include <ctype.h>
#ifdef AMIGA_LC_5_1
#include <string.h>
#endif

#define MAX_NAME_LEN	256
#define MAX_LINE_LEN	256
#define LINE_SKIP		3

#define TRUE 1
#define FALSE 0

typedef int boolean;

static boolean intable = FALSE;

main()
{
	init(stdout);
	convert(stdin,stdout);
	finish(stdout);
	exit(0);
}


init(b)
FILE *b;
{
    /* in nroff, increase line length by 8 and don't adjust lines */
    (void) fputs(".if n \\{.nr LL +8m\n.na \\}\n",b);
    (void) fputs(".nr PO +0.3i\n",b);
    (void) fputs(".so titlepage.ms\n",b);
    (void) fputs(".pn 1\n",b);
    (void) fputs(".bp\n",b);
    (void) fputs(".ta 1.5i 3.0i 4.5i 6.0i 7.5i\n",b);
    (void) fputs("\\&\n.sp 3\n.PP\n",b);
    /* following line commented out by rjl
	  (void) fputs(".so intro\n",b);
	  */
}


convert(a,b)
	FILE *a,*b;
{
    static char line[MAX_LINE_LEN];

    while (fgets(line,MAX_LINE_LEN,a)) {
	   process_line(line, b);
    }
}

process_line(line, b)
	char *line;
	FILE *b;
{
    switch(line[0]) {		/* control character */
	   case '?': {			/* interactive help entry */
		  break;			/* ignore */
	   }
	   case '@': {			/* start/end table */
		  if (intable) {
			 (void) fputs(".TE\n.KE\n", b);
			 (void) fputs(".EQ\ndelim off\n.EN\n\n",b);
			 intable = FALSE;
		  } else {
			 (void) fputs("\n.EQ\ndelim $$\n.EN\n",b);
			 (void) fputs(".KS\n.TS\ncenter box tab (@) ;\n", b);
			 (void) fputs("c c l .\n", b);
			 intable = TRUE;
		  }
		  /* ignore rest of line */
		  break;
	   }
	   case '#': {			/* latex table entry */
		  break;			/* ignore */
	   }
	   case '%': {			/* troff table entry */
		  if (intable)
		    (void) fputs(line+1, b); /* copy directly */
		  else
		    fprintf(stderr, "error: % line found outside of table\n");
		  break;
	   }
	   case '\n':			/* empty text line */
	   case ' ': {			/* normal text line */
		  if (intable)
		    break;		/* ignore while in table */
		  switch(line[1]) {
			 case ' ': {
				/* verbatim mode */
				fputs(".br\n",b); 
				fputs(line+1,b); 
				fputs(".br\n",b);
				break;
			 }
			 case '\'': {
				fputs("\\&",b);
				putms(line+1,b); 
				break;
			 }
			 default: {
				if (line[0] == '\n')
				  putms(line,b); /* handle totally blank line */
				else
				  putms(line+1,b);
				break;
			 }
			 break;
		  }
		  break;
	   }
	   default: {
		  if (isdigit(line[0])) { /* start of section */
			 if (!intable)	/* ignore while in table */
			   section(line, b);
		  } else
		    fprintf(stderr, "unknown control code '%c' in column 1\n", 
				  line[0]);
		  break;
	   }
    }
}


/* process a line with a digit control char */
/* starts a new [sub]section */

section(line, b)
	char *line;
	FILE *b;
{
    static char string[MAX_LINE_LEN];
    int sh_i;
    static int old = 1;

  
#ifdef AMIGA_LC_5_1
    (void) sscanf(line,"%d",&sh_i);
    strcpy(string,strchr(line,' ')+1);
    {
      char *p;
      p = strchr(string,'\n');
      if (p != NULL) *p = '\0';
    }
#else
    (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
#endif
    
    (void) fprintf(b,".sp %d\n",(sh_i == 1) ? LINE_SKIP : LINE_SKIP-1);
    
    if (sh_i > old) {
	   do
		if (old!=1)	/* this line added by rjl */
		  (void) fputs(".RS\n.IP\n",b);
	   while (++old < sh_i);
    }
    else if (sh_i < old) {
	   do
			   if (sh_i!=1) /* this line added by rjl */
				(void) fputs(".RE\n.br\n",b);
	   while (--old > sh_i);
    }
    
    /* added by dfk to capitalize section headers */
    if (islower(string[0]))
	 string[0] = toupper(string[0]);
    
    /* next 3 lines added by rjl */
    if (sh_i!=1) 
	 (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i-1,string);
    else 
	 (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i,string);
    old = sh_i;
    
    (void) fputs(".XS\n",b);
    (void) fputs(string,b);
    (void) fputs("\n.XE\n",b);
}

putms(s, file)
	char *s;
	FILE *file;
{
    static boolean inquote = FALSE;

    while (*s != '\0') {
	   switch (*s) {
		  case '`': {		/* backquote -> boldface */
			 if (inquote) {
				fputs("\\fR", file);
				inquote = FALSE;
			 } else {
				fputs("\\fB", file);
				inquote = TRUE;
			 }
			 break;
		  }
		  case '\\': {		/* backslash */
			 fputs("\\\\", file);
			 break;
		  }
		  default: {
			 fputc(*s, file);
			 break;
		  }
	   }
	   s++;
    }
}

finish(b)		/* spit out table of contents */
FILE *b;
{
	(void) fputs(".pn 1\n",b);
	(void) fputs(".ds RH %\n",b);
	(void) fputs(".af % i\n",b);
	(void) fputs(".bp\n.PX\n",b);
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































































































































































































































































































Deleted r34.1/plot/docs/doc2tex version [56f0bb4de7].

cannot compute difference between binary files

Deleted r34.1/plot/docs/doc2tex.c version [cad09ead23].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#ifndef lint
static char *RCSid = "$Id: doc2tex.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $";
#endif

/*
 * doc2tex.c  -- program to convert Gnuplot .DOC format to LaTeX document
 * Also will work for VMS .HLP files. 
 * Modified by Russell Lang from hlp2ms.c by Thomas Williams 
 * Extended by David Kotz to support quotes ("), backquotes, tables.
 *
 * usage:  doc2tex < file.doc > file.tex
 *
 *   where file.doc is a Gnuplot .DOC file, and file.tex will be an
 *     article document suitable for printing with LaTeX.
 *
 * typical usage for GNUPLOT:
 *
 *   doc2tex < gnuplot.doc > gnuplot.tex 
 *   latex gnuplot.tex ; latex gnuplot.tex
 */

static char rcsid[] = "$Id: doc2tex.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $";

#include <stdio.h>
#include <ctype.h>
#ifdef AMIGA_LC_5_1
#include <string.h>
#endif

#define MAX_NAME_LEN	256
#define MAX_LINE_LEN	256
#define TRUE 1
#define FALSE 0

typedef int boolean;

boolean intable = FALSE;
boolean verb = FALSE;

main()
{
	init(stdout);
	convert(stdin,stdout);
	finish(stdout);
	exit(0);
}


init(b)
FILE *b;
{
	(void) fputs("\\input{titlepage.tex}\n",b);
}


convert(a,b)
	FILE *a,*b;
{
    static char line[MAX_LINE_LEN];

    while (fgets(line,MAX_LINE_LEN,a)) {
	   process_line(line, b);
    }
}

process_line(line, b)
	char *line;
	FILE *b;
{
    switch(line[0]) {		/* control character */
	   case '?': {			/* interactive help entry */
		  break;			/* ignore */
	   }
	   case '@': {			/* start/end table */
		  if (intable) {
			 (void) fputs("\\hline\n\\end{tabular}\n", b);
			 (void) fputs("\\end{center}\n",b);
			 intable = FALSE;
		  } else {
			 if (verb) {
				(void) fputs("\\end{verbatim}\n",b);
				verb=FALSE;
			 } 
			 (void) fputs("\n\\begin{center}\n", b);
			 (void) fputs("\\begin{tabular}{|ccl|} \\hline\n", b);
			 intable = TRUE;
		  }
		  /* ignore rest of line */
		  break;
	   }
	   case '#': {			/* latex table entry */
		  if (intable)
		    (void) fputs(line+1, b); /* copy directly */
		  else
		    fprintf(stderr, "error: # line found outside of table\n");
		  break;
	   }
	   case '%': {			/* troff table entry */
		  break;			/* ignore */
	   }
	   case '\n':			/* empty text line */
	   case ' ': {			/* normal text line */
		  if (intable)
		    break;		/* ignore while in table */
		  if (line[1] == ' ') {
			 /* verbatim mode */
			 if (!verb) {
				(void) fputs("\\begin{verbatim}\n",b);
				verb=TRUE;
			 }
			 (void) fputs(line+1,b); 
		  } else {
			 if (verb) {
				(void) fputs("\\end{verbatim}\n",b);
				verb=FALSE;
			 } 
			 if (line[0] == '\n')
			   puttex(line,b); /* handle totally blank line */
			 else
			   puttex(line+1,b);
		  }
		  break;
	   }
	   default: {
		  if (isdigit(line[0])) { /* start of section */
			 if (!intable)	/* ignore while in table */
			   section(line, b);
		  } else
		    fprintf(stderr, "unknown control code '%c' in column 1\n", 
				  line[0]);
		  break;
	   }
    }
}

/* process a line with a digit control char */
/* starts a new [sub]section */

section(line, b)
	char *line;
	FILE *b;
{
    static char string[MAX_LINE_LEN];
    int sh_i;

    if (verb) {
	   (void) fputs("\\end{verbatim}\n",b);
	   verb=FALSE;
    } 
#ifdef AMIGA_LC_5_1
    (void) sscanf(line,"%d",&sh_i);
    strcpy(string,strchr(line,' ')+1);
    {
      char *p;
      p = strchr(string,'\n');
      if (p != NULL) *p = '\0';
    }
#else
    (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
#endif
    switch(sh_i)
	 {
		case 1: 
		(void) fprintf(b,"\\section{");
		break;
		case 2: 
		(void) fprintf(b,"\\section{");
		break;
		case 3:
		(void) fprintf(b,"\\subsection{");
		break;
		case 4: 
		(void) fprintf(b,"\\subsubsection{");
		break;
		default:
		case 5: 
		(void) fprintf(b,"\\paragraph{");
		break;
	 }
    if (islower(string[0]))
	 string[0] = toupper(string[0]);
    puttex(string,b);
    (void) fprintf(b,"}\n");
}

/* put text in string str to file while buffering special TeX characters */
puttex(str,file)
FILE *file;
register char *str;
{
register char ch;
static boolean inquote = FALSE;

	 while( (ch = *str++) != '\0') {
		 switch(ch) {
			 case '#':
			 case '$':
			 case '%':
			 case '&':
			 case '_':
			 case '{':
			 case '}':
				 (void) fputc('\\',file);
				 (void) fputc(ch,file);
				 break;
			 case '\\':
				 (void) fputs("$\\backslash$",file);
				 break;
			 case '~':
				 (void) fputs("\\~{\\ }",file);
				 break;
			 case '^':
				 (void) fputs("\\verb+^+",file);
				 break;
			 case '>':
			 case '<':
			 case '|':
				 (void) fputc('$',file);
				 (void) fputc(ch,file);
				 (void) fputc('$',file);
				 break;
			 case '"': 
				 /* peek at next character: if space, end of quote */
				 if (*str == NULL || isspace(*str) || ispunct(*str))
				   (void) fputs("''", file);
				 else
				   (void) fputs("``", file);
				 break;
			 case '`':	/* backquotes mean boldface */
				 if (inquote) {
					fputs("}", file);
					inquote = FALSE;
				 } else {
					fputs("{\\bf ", file);
					inquote = TRUE;
				 }
				 break;
			 default:
				 (void) fputc(ch,file);
				 break;
		 }
	 }
}


finish(b)
FILE *b;
{
	(void) fputs("\\end{document}\n",b);
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































































































































































































































































































































































































































Deleted r34.1/plot/docs/gnuplot.1 version [afc143dcd7].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
.\" dummy line
.TH GNUPLOT 1 "31 August 1990"
.UC 4
.SH NAME
gnuplot \- an interactive plotting program
.SH SYNOPSIS
.B gnuplot
[ X11 options ] [file ...]
.br
.SH DESCRIPTION
.I Gnuplot 
is a command-driven interactive function plotting program.
.PP
If files are given, 
.I gnuplot 
loads each file with the 
.I load
command, in the order specified.
.I Gnuplot 
exits after the last file is processed.
.PP
Here are some of its features:
.PP
Plots any number of functions, built up of C operators, C library
functions, and some things C doesn't have like **, sgn(), etc.  Also
support for plotting data files, to compare actual
data to theoretical curves.
.PP
User-defined X and Y ranges (optional auto-ranging), smart axes scaling,
smart tic marks.
.PP
Labelling of X and Y axes.
.PP
User-defined constants and functions.
.PP
Support through a generalized graphics driver for
AED 512,
AED 767,
BBN BitGraph,
Commodore Amiga,
Roland DXY800A,
EEPIC,
EmTeX,
Epson 60dpi printers,
Epson LX-800,
Fig, 
HP2623,
HP2648,
HP75xx,
HPGL,
HP LaserJet II,
Imagen,
Iris 4D,
Kermit-MS,
Kyocera laser printer,
LaTeX,
NEC CP6 pinwriter,
PostScript,
QMS QUIC,
ReGis (VT125 and VT2xx),
SCO Xenix CGI,
Selanar,
Star color printer,
Tandy DMP-130 printer,
Tek 401x,
Tek 410x,
Vectrix 384,
VT like tekronix emulator,
Unix PC (ATT 3b1 or ATT 7300),
unixplot,  
and X11.
The PC version compiled by Microsoft C
supports IBM CGA, EGA, VGA, Hercules, ATT 6300,
and Corona 325 graphics.  
The PC version compiled by Turbo C
supports IBM CGA, EGA, MCGA, VGA, Hercules and ATT 6300 graphics.  
Other devices can be added simply, but will require recompiling.
.PP
Shell escapes and command line substitution.
.PP
Load and save capability.
.PP
Output redirection.
.PP
All computations performed in the complex domain.  Just the real part is
plotted by default, but functions like imag() and abs() and arg() are
available to override this.
.SH X11 OPTIONS
.I Gnuplot 
provides two terminal types (\fIx11\fP and \fIX11\fP) for use
with X servers. The \fIX11\fP terminal type provides differing colors as well 
as shapes for the \fIpoints\fP plotting style. The two types are otherwise 
identical.  When used with either of these terminal types, \fIgnuplot\fP
accepts all the standard X Toolkit options and resources such as geometry, font,
and background. See the X(1) man page for a description of
the options. 
.PP
In addition to the X Toolkit options, there are three more
command line options. \fB\-mono\fP forces monochrome rendering on
color displays.
\fB\-gray\fP requests grayscale rendering on grayscale or color displays. 
(Grayscale displays receive monochrome rendering by default.) 
\fB\-clear\fP requests that the window be cleared momentarily before a
new plot is displayed. These options may also be controlled with resources.
For example: \fBgnuplot*gray: on\fP .

For color displays \fIgnuplot\fP honors 
the following resources (shown here with default values):
.sp
.B  "gnuplot*background: white"
.br 
.B  "gnuplot*textColor: black"
.br 
.B  "gnuplot*borderColor: black"
.br 
.B  "gnuplot*axisColor: black"
.br 
.B  "gnuplot*line1Color: red"
.br 
.B  "gnuplot*line2Color: green"
.br 
.B  "gnuplot*line3Color: blue"
.br 
.B  "gnuplot*line4Color: magenta"
.br 
.B  "gnuplot*line5Color: cyan"
.br 
.B  "gnuplot*line6Color: sienna"
.br 
.B  "gnuplot*line7Color: orange"
.br 
.B  "gnuplot*line8Color: coral"
.br 

When \fB\-gray\fP is selected, \fIgnuplot\fP honors 
the following resources for grayscale or color displays (shown here with 
default values). Note that the default background is black.
.sp
.B  "gnuplot*background: black"
.br 
.B  "gnuplot*textGray: white"
.br 
.B  "gnuplot*borderGray: gray50"
.br 
.B  "gnuplot*axisGray: gray50"
.br 
.B  "gnuplot*line1Gray: gray100"
.br 
.B  "gnuplot*line2Gray: gray60"
.br 
.B  "gnuplot*line3Gray: gray80"
.br 
.B  "gnuplot*line4Gray: gray40"
.br 
.B  "gnuplot*line5Gray: gray90"
.br 
.B  "gnuplot*line6Gray: gray50"
.br 
.B  "gnuplot*line7Gray: gray70"
.br 
.B  "gnuplot*line8Gray: gray30"
.br 

.PP
The size or aspect ratio of a plot may be changed by resizing the
.I gnuplot
window.
.SH AUTHORS
Thomas Williams, Pixar Corporation, 
.br
(info-gnuplot@ames.arc.nasa.gov)
.br
and Colin Kelley.
.PP
Additions for labelling by Russell Lang, Monash University, Australia.
.br
(rjl@monu1.cc.monash.edu.au)
.br
Further additions by David Kotz, Dartmouth College, New Hampshire, USA
(formerly of Duke University, North Carolina, USA).  
.br
(David.Kotz@Dartmouth.edu)
.br
X11 support by Ed Kubaitis, University of Illinois, USA.
.SH BUGS
The atan() function does not work correctly for complex arguments.
.br
The bessel functions do not work for complex arguments.
.br
See the 
.I help bugs
command in gnuplot.
.SH SEE ALSO
See the printed manual or the on-line help for details on specific commands.
.br
X(1).
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































































































































































































































































Deleted r34.1/plot/docs/gnuplot.aux version [9d74298b7c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
\relax 
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1}Gnuplot}{1}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2}Cd}{1}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3}Clear}{1}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4}Command-line editing}{1}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {5}Comment}{2}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {6}Environment}{2}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {7}Exit}{3}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {8}Expressions}{3}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {8.1}Functions}{3}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {8.2}Operators}{4}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {8.2.1}Binary}{4}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {8.2.2}Unary}{5}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {9}Help}{5}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {10}Load}{6}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {11}Pause}{6}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {12}Plot}{6}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {12.1}Data-file}{7}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {12.1.1}Using}{8}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {12.2}Errorbars}{10}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {12.3}Parametric}{10}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {12.4}Ranges}{11}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {12.5}Style}{12}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {12.6}Title}{13}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {13}Print}{13}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {14}Pwd}{13}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {15}Quit}{14}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {16}Replot}{14}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {17}Save}{14}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {18}Set-show}{14}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.1}Angles}{14}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.2}Arrow}{15}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.3}Autoscale}{15}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.3.1}Parametric mode}{16}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.4}Border}{17}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.5}Clip}{17}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.6}Cntrparam}{17}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.7}Contour}{18}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.8}Data style}{18}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.9}Dummy}{18}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.10}Format}{19}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.11}Function style}{19}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.12}Functions}{19}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.13}Grid}{20}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.14}Hidden3d}{20}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.15}Isosamples}{20}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.16}Key}{20}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.17}Label}{21}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.18}Logscale}{22}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.19}Mapping}{22}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.20}Offsets}{23}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.21}Output}{23}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.22}Parametric}{23}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.23}Polar}{24}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.24}Rrange}{25}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.25}Samples}{25}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.26}Size}{25}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.27}Style}{26}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.28}Surface}{26}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.29}Terminal}{27}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.1}Dumb}{27}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.2}Hpljii}{27}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.3}Iris4d}{27}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.4}Pbm}{28}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.5}Postscript}{28}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.6}Aifm}{29}}
\@writefile{toc}{\string\contentsline\space {subsubsection}{\string\numberline\space {18.29.7}Table}{29}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.30}Tics}{29}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.31}Time}{30}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.32}Title}{30}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.33}Trange}{31}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.34}Urange}{31}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.35}Variables}{31}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.36}View}{31}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.37}Vrange}{32}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.38}Xlabel}{32}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.39}Xrange}{32}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.40}Xtics}{33}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.41}Xzeroaxis}{33}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.42}Ylabel}{33}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.43}Yrange}{34}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.44}Ytics}{34}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.45}Yzeroaxis}{34}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.46}Zero}{35}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.47}Zeroaxis}{35}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.48}Zlabel}{35}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.49}Zrange}{35}}
\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {18.50}Ztics}{36}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {19}Shell}{36}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {20}Splot}{36}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {21}Start-up}{36}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {22}Substitution}{36}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {23}User-defined}{37}}
\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {24}Bugs}{37}}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































Deleted r34.1/plot/docs/gnuplot.doc version [1740eed755].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
1 gnuplot
?
 GNUPLOT is a command-driven interactive function plotting program. It
 is case sensitive (commands and function names written in lowercase
 are not the same as those written in CAPS). All command names may be
 abbreviated, as long as the abbreviation is not ambiguous. Any number
 of commands may appear on a line, separated by semicolons (;).
 Strings are indicated with quotes.  They may be either single or double
 quotation marks, e.g.,

          load "filename"
          cd 'dir'
 
 Any command-line arguments are assumed to be names of files containing 
 GNUPLOT commands, with the exception of standard X11 arguments, which
 are processed first. Each file is loaded with the `load` command, in the
 order specified. GNUPLOT exits after the last file is processed.  When
 no load files are named, gnuplot enters into an interactive mode.
 
 Commands may extend over several input lines, by ending each 
 line but the last with a backslash (\). The backslash must be the LAST
 character on each line. The effect is as if the backslash and newline
 were not there. That is, no white space is implied, nor is a comment
 terminated. Therefore, commenting out a continued line comments out
 the entire command (see `comment`).
 
 In this documentation, curly braces ({}) denote optional arguments to
 many commands, and a vertical bar (|) separates mutually exclusive
 choices.  GNUPLOT keywords or help topics are indicated by backquotes
 or `boldface` (where available).  Angle brackets (<>) are used to mark
 replaceable tokens.
 
 For help on any topic, type `help` followed by the name of the topic.

 The new GNUPLOT user should begin by reading about the `plot`
 command (type `help plot`).
2 cd
?cd
 The `cd` command changes the working directory.
 
 Syntax:
         cd "<directory-name>"
 
 The directory name must be enclosed in quotes.
 
 Examples:
         cd 'subdir'
         cd ".."
2 clear
?clear
 The `clear` command erases the current screen or output device as
 specified by `set output`. This usually generates a formfeed on
 hardcopy devices. Use `set terminal` to set the device type.
2 command-line editing
?line-editing
?editing
?history
 The Unix and IBM PC versions of GNUPLOT support command-line editing.
 Also, a history mechanism allows previous commands to be edited, and
 re-executed. After the command line has been edited, a newline or
 carriage return will enter the entire line regardless of where the
 cursor is positioned.

 The editing commands are as follows:
 
@start table - first is interactive cleartext form
 `Line editing`:
 
 ^B moves back a single character.
 ^F moves forward a single character.
 ^A moves to the beginning of the line.
 ^E moves to the end of the line.
 ^H and DEL delete the previous character.
 ^D deletes the current character.
 ^K deletes from current position to the end of line.
 ^L,^R redraws line in case it gets trashed.
 ^U deletes the entire line.
 ^W deletes the last word.

 `History`:
 
 ^P moves back through history.
 ^N moves forward through history.
#Character && Function \\ \hline 
#\multicolumn{3}{|c|}{Line Editing}\\
#\verb~^B~ && move back a single character.\\
#\verb~^F~ && move forward a single character.\\
#\verb~^A~ && move to the beginning of the line.\\
#\verb~^E~ && move to the end of the line.\\
#\verb~^H, DEL~ && delete the previous character.\\
#\verb~^D~ && delete the current character.\\
#\verb~^K~ && delete from current position to the end of line.\\
#\verb~^L, ^R~ && redraw line in case it gets trashed.\\
#\verb~^U~ && delete the entire line. \\
#\verb~^W~ && delete from the current word to the end of line. \\ \hline
#\multicolumn{3}{|c|}{History} \\
#\verb~^P~ && move back through history.\\
#\verb~^N~ && move forward through history.\\
%Character@@Function
%_
%@@Line Editing
%^B@@move back a single character.
%^F@@move forward a single character.
%^A@@move to the beginning of the line.
%^E@@move to the end of the line.
%^H, DEL@@delete the previous character.
%^D@@delete the current character.
%^K@@delete from current position to the end of line.
%^L, ^R@@redraw line in case it gets trashed.
%^U@@delete the entire line.
%^W@@delete from the current word to the end of line.
%_
%@@History
%^P@@move back through history.
%^N@@move forward through history.
@end table 

 On the IBM PC the use of a TSR program such as DOSEDIT or CED may be
 desired for line editing. For such a case GNUPLOT may be compiled with
 no line editing capability (default makefile setup). Set READLINE in the
 makefile and add readline.obj to the link file if GNUPLOT line editing
 is to be used for the IBM PC. The following arrow keys may be used
 on the IBM PC version if readline is used:
 
@start table - first is interactive cleartext form
 Left  Arrow     - same as ^B.
 Right Arrow     - same as ^F.
 Ctl Left  Arrow - same as ^A.
 Ctl Right Arrow - same as ^E.
 Up    Arrow     - same as ^P.
 Down  Arrow     - same as ^N.
#Arrow key & Function & \\ \hline 
#Left      & same as \verb~^B~. & \\
#Right     & same as \verb~^F~. & \\
#Ctl Left  & same as \verb~^A~. & \\
#Ctl Right & same as \verb~^E~. & \\
#Up        & same as \verb~^P~. & \\
#Down      & same as \verb~^N~. & \\
%Arrow key@@Function
%_
%Left Arrow@@same as ^B.
%Right Arrow@@same as ^F.
%Ctl Left Arrow@@same as ^A.
%Ctl Right Arrow@@same as ^E.
%Up Arrow@@same as ^P.
%Down Arrow@@same as ^N.
%_
@end table
 (The readline function in gnuplot is not the same as the readline used
 in GNU BASH and GNU EMACS.  It is somewhat compatible however.) 
2 comment
?comments
 Comments are supported as follows: a # may appear in most places in a line
 and GNUPLOT will ignore the rest of the line. It will not have this
 effect inside quotes, inside numbers (including complex numbers), inside
 command substitutions, etc. In short, it works anywhere it makes sense
 to work.
2 environment
?environment
 A number of shell environment variables are understood by GNUPLOT.
 None of these are required, but may be useful.
 
 If GNUTERM is defined, it is used as the name of the terminal type to
 be used. This overrides any terminal type sensed by GNUPLOT on start
 up, but is itself overridden by the .gnuplot (or equivalent) start-up
 file (see `start-up`), and of course by later explicit changes.
 
 On Unix, AmigaDOS, and MS-DOS, GNUHELP may be defined to be the pathname
 of the HELP file (gnuplot.gih).

 On VMS, the symbol GNUPLOT$HELP should be defined as the name of 
 the help library for GNUPLOT.
 
 On Unix, HOME is used as the name of a directory to search for 
 a .gnuplot file if none is found in the current directory.
 On AmigaDOS and MS-DOS, GNUPLOT is used. On VMS, SYS$LOGIN: is used.
 See help start-up.
 
 On Unix, PAGER is used as an output filter for help messages.
 
 On Unix and AmigaDOS, SHELL is used for the `shell` command. On MS-DOS,
 COMSPEC is used for the `shell` command.

 On AmigaDOS, GNUFONT is used for the screen font.  For example:
 "setenv GNUFONT sapphire/14".

 On MS-DOS, if the BGI interface is used, the variable `BGI` is used to point 
 to the full path to the BGI drivers directory. Furthermore SVGA is used to
 name the Super VGA BGI driver in 800x600 res., and its mode of operation
 as 'Name.Mode'.
 For example, if the Super VGA driver is C:\TC\BGI\SVGADRV.BGI and mode 3 is
 used for 800x600 res., then: 'set BGI=C:\TC\BGI' and 'set SVGA=SVGADRV.3'.
2 exit
?exit
?quit
 The commands `exit` and `quit` and the END-OF-FILE character
 will exit GNUPLOT. All these commands will clear the output device
 (as the `clear` command does) before exiting.
2 expressions
?expressions
 In general, any mathematical expression accepted by C, FORTRAN,
 Pascal, or BASIC is valid. The precedence of these operators is
 determined by the specifications of the C programming language.
 White space (spaces and tabs) is ignored inside expressions.
 
 Complex constants may be expressed as the {<real>,<imag>}, where <real>
 and <imag> must be numerical constants. For example, {3,2}
 represents 3 + 2i; {0,1} represents `i` itself. The curly braces 
 are explicitly required here.
3 functions
?expressions functions
?functions
 The functions in GNUPLOT are the same as the corresponding functions
 in the Unix math library, except that all functions accept integer,
 real, and complex arguments, unless otherwise noted. The `sgn`
 function is also supported, as in BASIC.
@start table
#Function & Arguments & Returns \\ \hline
%Function@Arguments@Returns
%_
4 abs
?expressions functions abs
?functions abs
?abs
#abs(x) & any  &  absolute value of {\tt x}, $|x|$; same type \\
#abs(x) & complex &  length of {\tt x}, $\sqrt{{\mbox{real}(x)^{2} +
#\mbox{imag}(x)^{2}}}$ \\
%abs(x)@any@absolute value of x, $|x|$; same type 
%abs(x)@complex@length of x, $sqrt{roman real (x) sup 2 + roman imag (x) sup 2}$ 
 The `abs` function returns the absolute value of its argument. The
 returned value is of the same type as the argument.
 
 For complex arguments, abs(x) is defined as the length of x in the
 complex plane [i.e.,  sqrt(real(x)**2 + imag(x)**2) ].
4 acos
?expressions functions acos
?functions acos
?acos
#acos(x) & any  & $\cos^{-1} x$ (inverse cosine) in radians \\
%acos(x)@any@$cos sup -1 x$ (inverse cosine) in radians 
 The `acos` function returns the arc cosine (inverse cosine) of its
 argument. `acos` returns its argument in radians.
4 arg
?expressions functions arg
?functions arg
?arg
#arg(x) & complex & the phase of $x$ in radians\\
%arg(x)@complex@the phase of $x$ in radians
 The `arg` function returns the phase of a complex number, in radians.
4 asin
?expressions functions asin
?functions asin
?asin
#asin(x) & any  & $\sin^{-1} x$ (inverse sin) in radians \\
%asin(x)@any@$sin sup -1 x$ (inverse sin) in radians 
 The `asin` function returns the arc sin (inverse sin) of its argument.
 `asin` returns its argument in radians.
4 atan
?expressions functions atan
?functions atan
?atan
#atan(x) & any  & $\tan^{-1} x$ (inverse tangent) in radians \\
%atan(x)@any@$tan sup -1 x$ (inverse tangent) in radians 
 The `atan` function returns the arc tangent (inverse tangent) of its
 argument. `atan` returns its argument in radians.
4 besj0
?expressions functions besj0
?functions besj0
?besj0
#besj0(x) & radians &  $j_{0}$ Bessel function of $x$ \\
%besj0(x)@radians@$j sub 0$ Bessel function of $x$ 
 The `besj0` function returns the j0th Bessel function of its argument.
 `besj0` expects its argument to be in radians.
4 besj1
?expressions functions besj1
?functions besj1
?besj1
#besj1(x) & radians & $j_{1}$ Bessel function of $x$ \\
%besj1(x)@radians@$j sub 1$ Bessel function of $x$ 
 The `besj1` function returns the j1st Bessel function of its argument.
 `besj1` expects its argument to be in radians.
4 besy0
?expressions functions besy0
?functions besy0
?besy0
#besy0(x) & radians & $y_{0}$ Bessel function of $x$ \\
%besy0(x)@radians@$y sub 0$ Bessel function of $x$ 
 The `besy0` function returns the y0th Bessel function of its argument.
 `besy0` expects its argument to be in radians.
4 besy1
?expressions functions besy1
?functions besy1
?besy1
#besy1(x) & radians & $y_{1}$ Bessel function of $x$ \\
%besy1(x)@radians@$y sub 1$ Bessel function of $x$ 
 The `besy1` function returns the y1st Bessel function of its argument.
 `besy1` expects its argument to be in radians.
4 ceil
?expressions functions ceil
?functions ceil
?ceil
#ceil(x) & any & $\lceil x \rceil$, smallest integer not less than $x$
#(real part) \\
%ceil(x)@any@$left ceiling x right ceiling$, smallest integer not less than $x$ (real part) 
 The `ceil` function returns the smallest integer that is not less than its
 argument. For complex numbers, `ceil` returns the smallest integer
 not less than the real part of its argument.
4 cos
?expressions functions cos
?functions cos
?cos
#cos(x) & radians & $\cos x$, cosine of $x$ \\
%cos(x)@radians@$cos~x$, cosine of $x$ 
 The `cos` function returns the cosine of its argument. `cos` expects its
 argument to be in radians.
4 cosh
?expressions functions cosh
?functions cosh
?cosh
#cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \\
%cosh(x)@radians@$cosh~x$, hyperbolic cosine of $x$ 
 The `cosh` function returns the hyperbolic cosine of its argument.
 `cosh` expects its argument to be in radians.
4 exp
?expressions functions exp
?functions exp
?exp
#exp(x) & any & $e^{x}$,  exponential function of $x$ \\
%exp(x)@any@$e sup x$, exponential function of $x$ 
 The `exp` function returns the exponential function of its argument
 (`e` raised to the power of its argument).
4 floor
?expressions functions floor
?functions floor
?floor
#floor(x) & any & $\lfloor x \rfloor$,  largest integer not greater
#than $x$ (real part) \\
%floor(x)@any@$left floor x right floor$, largest integer not greater than $x$ (real part) 
 The `floor` function returns the largest integer not greater than its
 argument. For complex numbers, `floor` returns the largest
 integer not greater than the real part of its argument.
4 gamma
?expressions functions gamma
?functions gamma
?gamma
#gamma(x) & any & $\Gamma(\mbox{real}(x))$,  gamma function of real($x$) \\
%gamma(x)@any@$GAMMA ( roman real (x))$, gamma function of real ($x$)
 The `gamma` function returns the gamma function of the real part of
 its argument. For integer n, gamma(n+1) = n! .
 If the argument is a complex value, the imaginary component is ignored.
4 imag
?expressions functions imag
?functions imag
?imag
#imag(x) & complex &  imaginary part of $x$ as a real number \\
%imag(x)@complex@imaginary part of $x$ as a real number 
 The `imag` function returns the imaginary part of its argument as a
 real number.
4 int
?expressions functions int
?functions int
?int
#int(x) & real &  integer part of $x$, truncated toward zero \\
%int(x)@real@integer part of $x,$ truncated toward zero 
 The `int` function returns the integer part of its argument, truncated
 toward zero.
4 log
?expressions functions log
?functions log
?log
#log(x) & any & $\log_{e} x$,  natural logarithm (base $e$) of $x$ \\
%log(x)@any@$ln~x$, natural logarithm (base $e$) of $x$ 
 The `log` function returns the natural logarithm (base `e`) of its
 argument.
4 log10
?expressions functions log10
?functions log10
?log10
#log10(x) & any & $\log_{10} x$,  logarithm (base $10$) of $x$ \\
%log10(x)@any@${log sub 10}~x$, logarithm (base $10$) of $x$ 
 The `log10` function returns the logarithm (base 10) of its argument.
4 real
?expressions functions real
?functions real
?real
#real(x) & any &  real part of $x$ \\
%real(x)@any@real part of $x$ 
 The `real` function returns the real part of its argument.
4 sgn
?expressions functions sgn
?functions sgn
?sgn
#sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \\
%sgn(x)@any@1 if $x > 0$, -1 if $x < 0$, 0 if $x = 0$. $roman imag (x)$ ignored 
 The `sgn` function returns 1 if its argument is positive, -1 if its
 argument is negative, and 0 if its argument is 0. If the argument
 is a complex value, the imaginary component is ignored.
4 sin
?expressions functions sin
?functions sin
?sin
#sin(x) & radians & $\sin x$, sine of $x$ \\
%sin(x)@radians@$sin~x$, sine of $x$ 
 The `sin` function returns the sine of its argument. `sin` expects its
 argument to be in radians.
4 sinh
?expressions functions sinh
?functions sinh
?sinh
#sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \\
%sinh(x)@radians@$sinh~x$, hyperbolic sine $x$ 
 The `sinh` function returns the hyperbolic sine of its argument. `sinh`
 expects its argument to be in radians.
4 sqrt
?expressions functions sqrt
?functions sqrt
?sqrt
#sqrt(x) & any & $\sqrt{x}$,  square root of $x$ \\
%sqrt(x)@any@$sqrt x $, square root of $x$ 
 The `sqrt` function returns the square root of its argument.
4 tan
?expressions functions tan
?functions tan
?tan
#tan(x) & radians & $\tan x$,  tangent of $x$ \\
%tan(x)@radians@$tan~x$, tangent of $x$ 
 The `tan` function returns the tangent of its argument. `tan` expects
 its argument to be in radians.
4 tanh
?expressions functions tanh
?functions tanh
?tanh
#tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\\
%tanh(x)@radians@$tanh~x$, hyperbolic tangent of $x$
 The `tanh` function returns the hyperbolic tangent of its argument.
 `tanh` expects its argument to be in radians.
@end table
3 operators
?expressions operators
?operators
 The operators in GNUPLOT are the same as the corresponding operators
 in the C programming language, except that all operators accept
 integer, real, and complex arguments, unless otherwise noted.
 The ** operator (exponentiation) is supported, as in FORTRAN.
 
 Parentheses may be used to change order of evaluation.
4 binary
?expressions operators binary
?operators binary
?binary
 The following is a list of all the binary operators and their
 usages:
 
@start table - first is interactive cleartext form
  Symbol      Example      Explanation
   **          a**b          exponentiation
   *           a*b           multiplication
   /           a/b           division
   %           a%b         * modulo
   +           a+b           addition
   -           a-b           subtraction
   ==          a==b          equality
   !=          a!=b          inequality
   &           a&b         * bitwise AND
   ^           a^b         * bitwise exclusive OR
   |           a|b         * bitwise inclusive OR
   &&          a&&b        * logical AND
   ||          a||b        * logical OR
   ?:          a?b:c       * ternary operation
#\multicolumn{3}{|c|}{Binary Operators} \\
#Symbol & Example & Explanation \\ \hline
#\verb~**~ & \verb~a**b~ & exponentiation\\
#\verb~*~ & \verb~a*b~ & multiplication\\
#\verb~/~ & \verb~a/b~ & division\\
#\verb~%~ & \verb~a%b~ & * modulo\\
#\verb~+~ & \verb~a+b~ & addition\\
#\verb~-~ & \verb~a-b~ & subtraction\\
#\verb~==~ & \verb~a==b~ & equality\\
#\verb~!=~ & \verb~a!=b~ & inequality\\
#\verb~&~ & \verb~a&b~ & * bitwise AND\\
#\verb~^~ & \verb~a^b~ & * bitwise exclusive OR\\
#\verb~|~ & \verb~a|b~ & * bitwise inclusive OR\\
#\verb~&&~ & \verb~a&&b~ & * logical AND\\
#\verb~||~ & \verb~a||b~ & * logical OR\\
#\verb~?:~ & \verb~a?b:c~ & * ternary operation\\
%Symbol@Example@Explanation
%_
%**@a**b@exponentiation
%*@a*b@multiplication
%/@a/b@division
%%@a%b@* modulo
%+@a+b@addition
%-@a-b@subtraction
%==@a==b@equality
%!=@a!=b@inequality
%&@a&b@* bitwise AND
%^@a^b@* bitwise exclusive OR
%|@a|b@* bitwise inclusive OR
%&&@a&&b@* logical AND
%||@a||b@* logical OR
%?:@a?b:c@* ternary operation
 
@end table 
 (*) Starred explanations indicate that the operator requires
 integer arguments.
 
 Logical AND (&&) and OR (||) short-circuit the way they do in C.
 That is, the second && operand is not evaluated if the first is
 false; the second || operand is not evaluated if the first is true.
 
 The ternary operator evaluates its first argument (a). If it is
 true (non-zero) the second argument (b) is evaluated and returned,
 otherwise the third argument (c) is evaluated and returned.
4 unary
?expressions operators unary
?operators unary
?unary
 The following is a list of all the unary operators and their
 usages:
 
@start table - first is interactive cleartext form
  Symbol     Example      Explanation
   -           -a          unary minus
   ~           ~a        * one's complement
   !           !a        * logical negation
   !           a!        * factorial
#\multicolumn{3}{|c|}{Unary Operators}\\
#Symbol & Example & Explanation \\ \hline
#\verb@-@ & \verb@-a@ & unary minus \\
#\verb@~@ & \verb@~a@ & * one's complement \\
#\verb@!@ & \verb@!a@ & * logical negation \\
#\verb@!@ & \verb@a!@ & * factorial \\
%-@-a@unary minus
%~@~a@* one's complement
%!@!a@* logical negation
%!@a!@* factorial
 
@end table 
 (*) Starred explanations indicate that the operator requires an
 integer argument.
 
 The factorial operator returns a real number to allow a greater range.
2 help
?help
 The `help` command displays on-line help. To specify information on a
 particular topic use the syntax:
 
         help {<topic>}
 
 If <topic> is not specified, a short message is printed about
 GNUPLOT. After help for the requested topic is given, help for a
 subtopic may be requested by typing its name, extending the help
 request. After that subtopic has been printed, the request may be
 extended again, or simply pressing return goes back one level to the
 previous topic. Eventually, the GNUPLOT command line will return.
2 load
?load
 The `load` command executes each line of the specified input file as
 if it had been typed in interactively. Files created by the `save`
 command can later be `load`ed. Any text file containing valid
 commands can be created and then executed by the `load` command.
 Files being `load`ed may themselves contain `load` commands. See
 `comment` for information about comments in commands.
 
 The `load` command must be the last command on the line.
 
 Syntax:
         load "<input-file>"
 
 The name of the input file must be enclosed in quotes.
 
 Examples:
 
         load 'work.gnu'
         load "func.dat"
 
 The `load` command is performed implicitly on any file names given as
 arguments to GNUPLOT. These are loaded in the order specified, and
 then GNUPLOT exits.
2 pause
?pause
 The `pause` command displays any text associated with the command and
 then waits a specified amount of time or until the carriage return is
 pressed.  `pause` is especially useful in conjunction with `load` files.

 Syntax:
         pause <time> {"<string>"}

 <time> may be any integer constant or expression. Choosing -1 will
 wait until a carriage return is hit, zero (0) won't pause at all, and
 a positive integer will wait the specified number of seconds.
 
 Note: Since `pause` is not part of the plot it may interact with
 different device drivers differently (depending upon how text and
 graphics are mixed).
 
 Examples:
         pause -1    # Wait until a carriage return is hit
         pause 3     # Wait three seconds
         pause -1  "Hit return to continue"
         pause 10  "Isn't this pretty?  It's a cubic-spline."
 
2 plot
?plot
?splot
 `plot` and `splot` are the primary commands of the program. They plot
 functions and data in many, many ways. `plot` is used to plot 2-d
 functions and data, while `splot` plots 3-d surfaces and data.

 Syntax:
 
         plot {ranges}  <function> {title} {style}
                     {, <function> {title} {style}...}
 
         splot {ranges}  <function> {title} {style}
                      {, <function> {title} {style}...}
 
 where <function> is either a mathematical expression, the name of a
 data file enclosed in quotes, or a pair (`plot`) or triple (`splot`)
 of mathematical expressions in the case of parametric functions.
 User-defined functions and variables may also be defined here.
 
 `plot` and `splot` commands can be as simple as
 
         plot sin(x)
 
 and
 
         splot x * y
 
 or as complex as (!)
 
         plot [t=1:10] [-pi:pi*2] tan(t),"data.1" with lines,t**2 with points
3 data-file
?plot datafile
?plot data-file
?splot datafile
?splot data-file
?datafile
?data-file
?data
 Discrete data contained in a file can displayed by specifying the
 name of the data file (enclosed in quotes) on the `plot` or `splot`
 command line. Data files should contain one data point per line.
 Lines beginning with # (or ! on VMS) will be treated as comments
 and ignored. For `plot`s, each data point represents an (x,y)
 pair. For `splot`s, each point is an (x,y,z) triple. For `plot`s with
 error bars (see `plot errorbars`), each data point is either
 (x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
 line of a data file must be separated by blank space. This blank
 space divides each line into columns.

 For `plot`s the x value may be omitted, and for `splot`s the x
 and y values may be omitted. In either case the omitted values are
 assigned the current coordinate number. Coordinate numbers start at 0
 and are incremented for each data point read.

 To specify other formats, see `plot datafile using`.
 
 In the `plot` command, blank lines in the data file cause a break in
 the plot. There will be no line drawn between the preceding and
 following points if the plot style is `lines` or `linespoints` (see
 `plot style`). This does not change the plot style, as would plotting
 the data as separate curves.
 
 This example compares the data in the file population.dat to a
 theoretical curve:
 
         pop(x) = 103*exp((1965-x)/10)
         plot [1960:1990] 'population.dat', pop(x)
 
 The file population.dat might contain:
 
         # Gnu population in Antarctica since 1965
         1965   103
         1970   55
         1975   34
         1980   24
         1985   10
 
 When a data file is plotted, `samples` and `iso_samples` are ignored.
 Curves plotted using the `plot` command are automatically extended to
 hold the entire curve. Similarly grid data plotted using the `splot`
 command is automatically extended, using the assumption that isolines
 are separated by blank lines (a line with only a CR/LF in it).
 
 Implicitly, there are two types of 3-d datafiles. If all the isolines
 are of the same length, the data is assumed to be a grid data, i.e.,
 the data has a grid topology. Cross isolines in the other parametric
 direction (the ith cross isoline passes thru the ith point of all the
 provided isolines) will also be drawn for grid data. (Note contouring
 is available for grid data only.) If all the isolines are not of the
 same length, no cross isolines will be drawn and contouring that data
 is impossible.
 
 For splot if 3-d datafile and using format (see `splot datafile using`)
 specify only z (height field), a non parametric mode must be specified.
 If, on the other hand, x, y, and z are all specified, a parametric
 mode should be selected (see `set parametric`) since data is defining a
 parametric surface.

 A simple example of plotting a 3-d data file is
 
         set parametric
         splot 'glass.dat'
 
 or
 
         set noparametric
         splot 'datafile.dat'
 
 where the file datafile.dat might contain:
 
         # The valley of the Gnu.
         10
         10
         10
 
         10
         5
         10
 
         10
         1
         10
 
         10
         0
         10
 
 Note datafile.dat defines a 4 by 3 grid ( 4 rows of 3 points each ).
 Rows are separated by blank lines.

 On some computer systems with a popen function (UNIX), the datafile
 can be piped through a shell command by starting the file name
 with a '<'.  For example:

         pop(x) = 103*exp(x/10)
         plot '< awk "{print $1-1965 $2}" population.dat', pop(x)

 would plot the same information as the first population example
 but with years since 1965 as the x axis.
 
 For more information about 3-d plotting, see `splot`.
4 using
?plot datafile using
?plot data-file using
?splot datafile using
?splot data-file using
?using
 The format of data within a file can be selected with the `using` 
 option. An explicit scanf string can be used, or simpler column
 choices can be made.
 
 Syntax:
 
         plot "datafile" { using { <ycol> |
                                   <xcol>:<ycol> |
                                   <xcol>:<ycol>:<ydelta> |
                                   <xcol>:<ycol>:<ylow>:<yhigh> }
                                 {"<scanf string>"} } ...

 and

         splot "datafile" { using { <xcol>:<ycol>:<zcol> | <zcol> }
                                  {"<scanf string>"} } ...
 
 <xcol>, <ycol>, and <zcol> explicitly select the columns to plot from
 a space or tab separated multicolumn data file. If only <ycol> is
 selected for `plot`, <xcol> defaults to 1. If only <zcol> is selected
 for `splot`, then only that column is read from the file. An <xcol> of
 0 forces <ycol> to be plotted versus its coordinate number. <xcol>,
 <ycol>, and <zcol> can be entered as constants or expressions.

 If errorbars (see also `plot errorbars`) are used for `plot`s,
 ydelta (for example, a +/- error) should be provided as the third
 column, or ylow and yhigh as third and fourth columns.  These columns
 must follow the x and y columns.

 Scanf strings override any <xcol>:<ycol>(:<zcol>) choices, except for
 ordering of input, e.g.,
         plot "datafile" using 2:1 "%f%*f%f"
 causes the first column to be y and the third column to be x.

 If the scanf string is omitted, the default is generated based on the
 <xcol>:<ycol>(:<zcol>) choices. If the `using` option is omitted, "%f%f"
 is used for `plot` ("%f%f%f%f" for `errorbar` `plot`s) and "%f%f%f" is
 used for `splot`.
 
 Examples:
 
         plot "MyData" using "%*f%f%*20[^\n]%f" with lines

 Data are read from the file "MyData" using the format
 "%*f%f%*20[^\n]%f". The meaning of this format is: "%*f" ignore the
 first number, "%f" then read in the second and assign to x,
 "%*20[^\n]" then ignore 20 non-newline characters, "%f" then read in
 the y value.

         n=3;
         plot "MyData", "MyData" using n 

 causes GNUPLOT to plot the second and third columns of MyData versus
 the first column. The command 'n=4; replot' would then plot the second
 and fourth columns of MyData versus the first column.
 
         splot "glass.dat" using 1

 causes GNUPLOT to plot the first coordinate of the points of glass.dat
 as the z coordinate while ignoring the other two coordinates.
 
 Note: GNUPLOT first reads a line of the data file into a buffer and 
 then does a 
         sscanf(input_buffer, scanf_string, &x, &y{, &z});
 where 'x', 'y', and 'z' are of type 'float'. Any scanf string that
 specifies two (three for `splot`, three or four for `errorbars`) float
 numbers may be used.
3 errorbars
?plot errorbars
?errorbars
 Error bars are supported for 2-d data file plots by reading one or
 two additional columns specifying ydelta or ylow and yhigh
 respectively. No support exists for x error bars or any error bars
 for `splot`s.

 In the default situation, GNUPLOT expects to see three or four
 numbers on each line of the data file, either (x, y, ydelta) or 
 (x, y, ylow, yhigh). The x coordinate must be specified. The order
 of the numbers must be exactly as given above. Data files in this
 format can easily be plotted with error bars:

         plot "data.dat" with errorbars

 The error bar is a vertical line plotted from (x, ylow) to (x,
 yhigh). If ydelta is specified instead of ylow and yhigh, 
 ylow=y-ydelta and yhigh=y+ydelta are derived. If there
 are only two numbers on the line, yhigh and ylow are both set to
 y. To get lines plotted between the data points, `plot` the
 data file twice, once with errorbars and once with lines.

 If y autoscaling is on, the y range will be adjusted to fit the
 error bars.

 The `using` option may be used to specify how columns of the data file
 are to be assigned to x, y, ydelta, ylow, and yhigh. The x column must
 be provided and both the x and y columns must appear before the
 errorbar columns. If three column numbers are given, they are x, y,
 and ydelta. If four columns are given, they are x, y, ylow, and
 yhigh.

 Examples:
 
         plot "data.dat" using 1:2:3:4 with errorbars
         plot "data.dat" using 3:2:6 with errorbars
         plot "data.dat" using 3:4:8:7 with errorbars
 
 The first example reads, x, y, ylow, and yhigh, from columns 1, 2, 3,
 and 4. This is equivalent to the default.  The second example reads x
 from the third column, y from second and ydelta from the sixth column.
 The third example reads x from the third column, y from the fourth,
 ylow from the eighth, and yhigh from seventh columns.
 
 See also `plot using` and `plot style`.
3 parametric
?plot parametric
?splot parametric
?parametric
 When in parametric mode (`set parametric`) mathematical expressions must
 be given in pairs for `plot` and in triplets for `splot`:
         plot sin(t),t**2
 or
         splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
 
 Data files are plotted as before, except any preceding parametric
 function must be fully specified before a data file is given as a
 plot. In other words, the x parametric function (sin(t) above) and
 the y parametric function (t**2 above) must not be interrupted with
 any modifiers or data functions; doing so will generate a syntax error
 stating that the parametric function is not fully specified.
 
 Ranges take on a different meaning when in parametric mode. The first
 range on the `plot` command is the `trange`, the next is the `xrange`,
 and the last is the `yrange`. For `splot` the order is `urange`,
 `vrange`, `xrange`, `yrange`, and finally `zrange`. The following
 `plot` command shows setting the `trange` to [-pi:pi], the `xrange` to
 [-1.3:1.3] and the `yrange` to [-1:1] for the duration of the plot:
         plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
 
 Other modifiers, such as `with` and `title`, may be specified only
 after the parametric function has been completed:
         plot sin(t),t**2 title 'Parametric example' with linespoints
3 ranges
?splot ranges
?plot ranges
?ranges
 The optional range specifies the region of the plot that will be
 displayed.
 
 Ranges may be provided on the `plot` and `splot` command line and
 affect only that plot, or in the `set xrange`, `set yrange`, etc.,
 commands, to change the default ranges for future plots.
 
 Syntax:
         [{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }
 
 where <dummy-var> is the independent variable (the defaults are x and
 y, but this may be changed with `set dummy`) and the min and max
 terms can be constant expressions.
 
 Both the min and max terms are optional. The ':' is also optional
 if neither a min nor a max term is specified. This allows '[ ]' to
 be used as a null range specification.
 
 Specifying a range in the `plot` command line turns autoscaling for
 that axis off for that plot. Using one of the `set` range commands
 turns autoscaling off for that axis for future plots, unless changed
 later. (See `set autoscale`).
 
 Examples:
 
 This uses the current ranges:
         plot cos(x)
 
 This sets the x range only:
         plot [-10:30] sin(pi*x)/(pi*x)
 
 This is the same, but uses t as the dummy-variable:
         plot [t = -10 :30]  sin(pi*t)/(pi*t)
 
 This sets both the x and y ranges:
         plot [-pi:pi] [-3:3]  tan(x), 1/x
 
 This sets only the y range, and turns off autoscaling on both axes:
         plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
 
 This sets xmax and ymin only:
         plot [:200] [-pi:]  exp(sin(x))
 
 This sets the x, y, and z ranges:
         splot [0:3] [1:4] [-1:1] x*y
3 style
?plot style
?splot style
?style
?plot with
?with
 Plots may be displayed in one of six styles: `lines`, `points`,
 `linespoints`, `impulses`, `dots`, or `errorbars`. The `lines` style
 connects adjacent points with lines. The `points` style displays a
 small symbol at each point. The `linespoints` style does both
 `lines` and `points`. The `impulses` style displays a vertical line
 from the x axis (or from the grid base for `splot`) to each point. The
 `dots` style plots a tiny dot at each point; this is useful for
 scatter plots with many points.

 The `errorbars` style is only relevant to 2-d data file plotting. It
 is treated like `points` for `splot`s and function `plot`s. For data
 `plot`s, `errorbars` is like `points`, except that a vertical error 
 bar is also drawn: for each point (x,y), a line is drawn from
 (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
 bar. The ylow and yhigh values are read from the data file's columns,
 as specified with the `using` option to plot. See `plot errorbars` for
 more information.
 
 Default styles are chosen with the `set function style` and
 `set data style` commands.
 
 By default, each function and data file will use a different 
 line type and point type, up to the maximum number of available 
 types. All terminal drivers support at least six different point
 types, and re-use them, in order, if more than six are required.
 The LaTeX driver supplies an additional six point types (all variants
 of a circle), and thus will only repeat after twelve curves are
 plotted with points.
 
 If desired, the style and (optionally) the line type and point type
 used for a curve can be specified.

 Syntax:
 
         with <style> {<linetype> {<pointtype>}}
 
 where <style> is either `lines`, `points`, `linespoints`, `impulses`,
 `dots`, or `errorbars`. The <linetype> and <pointtype> are positive
 integer constants or expressions and specify the line type and point
 type to be used for the plot. Line type 1 is the first line type used
 by default, line type 2 is the second line type used by default, etc.
 
 Examples:
 
 This plots sin(x) with impulses:
         plot sin(x) with impulses
 
 This plots x*y with points, x**2 + y**2 default:
         splot x*y w points, x**2 + y**2
 
 This plots tan(x) with the default function style, "data.1" with lines:
         plot [ ] [-2:5] tan(x), "data.1" with l
 
 This plots "leastsq.dat" with impulses:
         plot 'leastsq.dat' w i
 
 This plots "exper.dat" with errorbars and lines connecting the points:
         plot 'exper.dat' w lines, 'exper.dat' w errorbars
 Here 'exper.dat' should have three or four data columns.
 
 This plots x**2 + y**2 and x**2 - y**2 with the same line type:
         splot x**2 + y**2 with line 1, x**2 - y**2 with line 1
 
 This plots sin(x) and cos(x) with linespoints, using the
 same line type but different point types:
         plot sin(x) with linesp 1 3, cos(x) with linesp 1 4
 
 This plots file "data" with points style 3:
         plot "data" with points 1 3 
 Note that the line style must be specified when specifying the point
 style, even when it is irrelevant. Here the line style is 1 and the
 point style is 3, and the line style is irrelevant.
 
 See `set style` to change the default styles.
3 title
?plot title
?splot title
 A title of each plot appears in the key. By default the title is
 the function or file name as it appears on the plot command line.
 The title can be changed by using the `title` option. This option 
 should precede any `with` option.
 
 Syntax:
         title "<title>"
 
 where <title> is the new title of the plot and must be enclosed in
 quotes. The quotes will not be shown in the key.
 
 Examples:
 
 This plots y=x with the title 'x':
         plot x
 
 This plots the "glass.dat" file with the title 'surface of revolution':
         splot "glass.dat" title 'surface of revolution'
 
 This plots x squared with title "x^2" and "data.1" with title
 'measured data':
         plot x**2 title "x^2", "data.1" t 'measured data'
2 print
?print
 The `print` command prints the value of <expression> to the screen.
 
 Syntax:
         print <expression>
 
 See `expressions`.
2 pwd
?pwd
 The `pwd` command prints the name of the working directory to the screen.
 
 Syntax:
         pwd
2 quit
?quit
 The `exit` and `quit` commands and END-OF-FILE character will exit
 GNUPLOT. All these commands will clear the output device (as the
 `clear` command does) before exiting.
2 replot
?replot
 The `replot` command without arguments repeats the last `plot` or `splot`
 command. This can be useful for viewing a plot with different `set`
 options, or when generating the same plot for several devices.
 
 Arguments specified after a `replot` command will be added onto the last
 `plot` (`splot`) command (with an implied ',' separator) before it is
 repeated. `replot` accepts the same arguments as the `plot` (`splot`)
 commands except that ranges cannot be specified. See `command-line
 editing` for ways to edit the last `plot` (`splot`) command.
2 save
?save
 The `save` command saves user-defined functions, variables, set
 options or all three plus the last `plot` (`splot`) command to the
 specified file.
 
 Syntax:
         save  {<option>} "<filename>"
 
 where <option> is `functions`, `variables` or `set`. If no option is
 used, GNUPLOT saves functions, variables, set options and the last `plot`
 (`splot`) command.
 
 `save`d files are written in text format and may be read by the `load`
 command.
 
 The filename must be enclosed in quotes.
 
 Examples:
 
         save "work.gnu"
         save functions 'func.dat'
         save var 'var.dat'
         save set "options.dat"
2 set-show
?set
?show
 The `set` command sets LOTS of options.
 
 The `show` command shows their settings. `show all` shows all the
 settings.
3 angles
?set angles
?show angles
?angles
 By default, GNUPLOT assumes the independent variable in polar plots
 is in units of radians. If `set angles degrees` is specified before
 `set polar` then the default range is [0:360] and the independent
 variable has units of degrees. This is particularly useful for
 plots of data files. The angle setting also hold for the 3-d
 mapping as set via the `set mapping` command.

 Syntax:
         set angles { degrees | radians }
         show angles
3 arrow
?set arrow
?set noarrow
?show arrow
?arrow
?noarrow
 Arbitrary arrows can be placed on a plot using the `set arrow`
 command.
 
 Syntax:
 
          set arrow {<tag>} {from <sx>,<sy>{,<sz>}} 
                            {to <ex>,<ey>{,<ez>}} {{no}head}
          set noarrow {<tag>}
          show arrow
 
 
 Unspecified coordinates default to 0. The x, y, and z values are in
 the graph's coordinate system. The z coordinate is only used in
 `splot` commands. <tag> is an integer that identifies the arrow. If no
 tag is given, the lowest unused tag value is assigned automatically.
 The tag can be used to delete or change a specific arrow. To change
 any attribute of an existing arrow, use the `set arrow` command with
 the appropriate tag, and specify the parts of the arrow to be
 changed. Specifying nohead requests the arrow be drawn without a head
 (yielding a line segment). By default, arrows have heads.
 
 Arrows outside the plotted boundaries are permitted but may cause
 device errors.
 
 Examples:
 
 To set an arrow pointing from the origin to (1,2), use:
          set arrow to 1,2
 To set an arrow from (-10,4,2) to (-5,5,3), and tag the arrow number
 3, use:
          set arrow 3 from -10,4,2 to -5,5,3
 To change the preceding arrow begin at 1,1,1, without an arrow head,
 use:
          set arrow 3 from 1,1,1 nohead
 To delete arrow number 2 use:
          set noarrow 2
 To delete all arrows use:
          set noarrow
 To show all arrows (in tag order) use:
          show arrow
3 autoscale
?set autoscale
?set noautoscale
?show autoscale
?autoscale
?noautoscale
 Auto scaling may be set individually on the x, y or z axis
 or globally on all axes. The default is to autoscale all axes.
 
 When autoscaling, the plot range is automatically computed and the
 dependent axis (y for a `plot` and z for `splot`) is scaled to
 include the range of the function or data being plotted.
 
 If autoscaling of the dependent axis (y or z) is not set, the
 current y or z range is used.
 
 See `set yrange` or `set zrange`.
 
 Autoscaling the independent variables (x for `plot` and x,y for
 `splot`) is a request to set the domain to match any data file being
 plotted. If there are no data files then autoscaling an independent
 variable has no effect. In other words, in the absence of a data
 file, functions alone do not affect the x range (or the y range if
 plotting z = f(x,y)).
 
 See `set xrange`, or `set yrange`.
 
 The behavior of autoscaling remains consistent in parametric mode,
 however, there are more dependent variables and hence more control
 over x, y, and z plot scales. In parametric mode, the independent or
 dummy variable is t for `plot`s and u,v for `splot`s.  Autoscale in
 parametric mode, then, controls all ranges (t, u, v, x, y, and z) and
 allows x, y, and z to be fully autoscaled.
 
 See `set parametric`.
 
 Syntax:
         set autoscale <axes>
         set noautoscale <axes>
         show autoscale
 
 where <axes> is either `x`, `y`, `z` or `xy`. If <axes> is not given
 then all axes are assumed.
 
 Examples:
 
 This sets autoscaling of the y axis. x axis autoscaling is not
 affected.
         set autoscale y
 
 This sets autoscaling of the x and y axes.
         set autoscale xy
 
 This sets autoscaling of the x, y and z axes.
         set autoscale
 
 This disables autoscaling of the x, y and z axes.
         set noautoscale
 
 This disables autoscaling of the z axis only.
         set noautoscale z
4 parametric mode
?autoscale parametric
?set autoscale t
 When in parametric mode (`set parametric`) the xrange is as
 fully scalable as the yrange. In other words, in parametric
 mode the x axis can be automatically scaled to fit the range
 of the parametric function that is being plotted. Of course,
 the y axis can also be automatically scaled just as in the
 non-parametric case. If autoscaling on the x axis is not set,
 the current x range is used.
 
 When there is a mix of data files and functions, the xrange of
 the functions is selected as that of the data files if autoscale
 is true for x. While this keeps the behavior compatible with
 non-parametric plotting, it may not be retained in the future.
 The problem is that, in parametric mode, the x and y ranges are
 not as distinguishable as in the non-parametric mode and this
 behavior may not be the most useful.
 
 For completeness a last command `set autoscale t` is accepted.
 However, the effect of this "scaling" is very minor. When
 GNUPLOT determines that the t range would be empty it makes a
 small adjustment if autoscaling is true. Otherwise, GNUPLOT
 gives an error. Such behavior may, in fact, not be very useful
 and the command `set autoscale t` is certainly questionable.
 
 `splot` extends the above idea similarly. If autoscaling is set then
 x, y, and z ranges are computed and each axis scaled to fit the
 resulting data.
3 border
?set border
?set noborder
?show border
?border
?noborder
 The `set border` and `set noborder` commands controls the display of
 the plot borders for the `plot` and `splot` commands.
 
 Syntax:
         set border
         set noborder
         show border
3 clip
?set clip
?set noclip
?show clip
?clip
?noclip
 GNUPLOT can clip data points and lines that are near the boundaries
 of a plot. 
 
 Syntax:
         set clip <clip-type>
         set noclip <clip-type>
         show clip

 Three clip types are supported by GNUPLOT: `points`, `one`, and `two`.
 One, two, or all three clip types may be active for a single plot.

 The `points` clip type forces GNUPLOT to clip (actually, not plot at
 all) data points that fall within but too close to the boundaries
 (this is so the large symbols used for points will not extend outside
 the boundary lines). Without clipping points near the boundaries may
 look bad; try adjusting the x and y ranges.

 Setting the `one` clip type causes GNUPLOT to plot the line segments
 which have only one of the two endpoints with the plotting region.
 Only the in-range portion of the line is drawn.  The alternative is to
 not draw any portion of the line segment.

 Some lines may have both endpoints out of range, but pass through the
 plotting area. Setting the `two` clip-type allows the visible portion
 of these lines to be drawn.
 
 In no case is a line drawn outside the plotting area.

 The defaults are `noclip points`, `clip one`, and `noclip two`.

 To check the state of all forms of clipping, use
         show clip

 For backward compatibility with older versions, the following forms
 are also permitted.
        set clip
        set noclip
 `set clip` is synonymous with `set clip points`. `set noclip` turns
 off all three types of clipping.
3 cntrparam
?set cntrparam
?show cntrparam
?cntrparam
 Sets the different parameters for the contouring plot (see also `contour`).
 
 Syntax:
         set cntrparam { { linear | cubicspline | bspline } |
                         points <n> |
                         levels <n> |
                         order <n> }
 
 This command controls the way contours are plotted. <n> should be an
 integral constant expression. The parameters are:
 
 `linear`, `cubicspline`, `bspline` - Controls type of approximation or
 interpolation. If `linear`, then the contours are drawn piecewise
 linear, as extracted from the surface directly. If `cubicspline`, then
 piecewise linear contours are interpolated to form a somewhat smoother
 contours, but which may undulate. The third option is the uniform
 `bspline`, which only approximates the piecewise linear data but is
 guaranteed to be smoother.
 
 `points` - Eventually all drawings are done with piecewise linear
 strokes.  This number controls the number of points used to
 approximate a curve.  Relevant for `cubicspline` and `bspline` modes
 only.
 
 `levels` - Number of contour levels. If the surface is bounded by zmin
 and zmax then contours will be generated from zmin+dz to zmax-dz
 in steps of size dz, where dz = (zmax - zmin) / (levels + 1).
 
 `order`  - Order of the bspline approximation to be used. The bigger this
 order is, the smoother the resulting contour.  (Of course, higher order
 bspline curves will move further away from the original peicewise linear
 data.)  This option is relevant for `bspline` mode only. Allowed values are 
 integers in the range from 2 (linear) to 10.
3 contour
?set contour
?show contour
?contour
 Enable contour drawing for surfaces. This option is available for `splot`
 only.
 
 Syntax:
         set contour { base | surface | both }
         set nocontour
 
 If no option is provided to `set contour`, the default is `base`.
 The three options specify where to draw the contours: `base` draws
 the contours on the grid base where the x/ytics are placed, `surface`
 draws the contours on the surfaces themselves, and `both` draws the
 contours on both the base and the surface.
 
 See also `set cntrparam` for the parameters that affect the drawing of 
 contours.
3 data style
?set data style
?show data style
?data style
 The `set data style` command changes the default plotting style
 for data plots.

 Syntax:
         set data style 
         show data style 
         set data style <style-choice>

 In the first case, `set data style` returns the possible style
 choices:  `lines`, `points`, `linespoints`, `dots`, `impulses`, 
 or `errorbars`.  `show data style` shows the current default
 plotting style for data.  `set data style dots` would actually 
 change the default plotting style.  See also `plot`.
3 dummy
?set dummy
?show dummy
?dummy
 By default, GNUPLOT assumes that the independent variable for the
 `plot` command is x, and the independent variables for the `splot`
 command are x and y. They are called the dummy variables because it
 is just a notation to indicate the independent variables. The `set
 dummy` command changes these default dummy variable names. For
 example, it may be more convenient to call the dummy variable t
 when plotting time functions:
 
         set dummy t
         plot sin(t), cos(t)
 
 Syntax:
         set dummy <dummy-var>{,<dummy-var>}
         show dummy
 
 Examples:
         set dummy u,v
         set dummy ,s
 
 to set both dummy variables to u and v or set only the second
 variable to s.
 
 The `set parametric` command also changes the dummy variables (to t
 for `plot` and u,v for `splot`s).
 
3 format
?set format
?show format
?format
 The format of the tic-mark labels can be set with the `set format`
 command. The default format for both axes is "%g", but other formats
 such as "%.2f" or "%3.0fm" are often desirable. Anything accepted by
 printf when given a double precision number, and then accepted by the
 terminal, will work. In particular, the formats f, e, and g will work,
 and the d, o, x, c, s, and u formats will not work.
 
 Syntax:
         set format {<axes>} {"<format-string>"}
         show format
 
 where <axes> is either `x`, `y`, `z`, `xy`, or nothing (which is the
 same as `xy`). The length of the string representing a ticmark (after
 formatting with printf) is restricted to 100 characters.  If the
 format string is omitted, the format will be returned to the default
 "%g". For LaTeX users, the format "$%g$" is often desirable.  If the
 empty string "" is used, no label will be plotted with each tic,
 though the tic mark will still be plotted. To eliminate all tic marks,
 use `set noxtics` or `set noytics`.
 
 See also `set xtics` and `set ytics` for more control over tic labels.
3 function style
?set function style
?show function style
?function style
 The `set function style` command changes the default plotting style
 for functions.

 Syntax:
         set function style 
         show function style 
         set function style <style-choice>

 In the first case, `set function style` returns the possible style
 choices:  `lines`, `points`, `linespoints`, `dots`, `impulses`, 
 or `errorbars`.  `show function style` shows the current default
 plotting style for functions.  `set function style linespoints`
 would actually change the default plotting style.  See also `plot`.
3 functions
?show functions
 The `show functions` command lists all user-defined functions and
 their definitions.
 
 Syntax:
         show functions
3 grid
?set grid
?show grid
?grid
 The optional `set grid` draws a grid at the tic marks with the axis
 linetype.
 
 Syntax:
         set grid
         set nogrid
         show grid
3 hidden3d
?set hidden3d
?show hidden3d
 The `set hidden3d` command enables hidden line removal for explicit
 surface plotting (see `splot`).
 Hidden line removal may be used for both explicit functions
 and for explicit data where gnuplot plot is in nonparametric mode (see
 `set parametric`).
 
 When this flag is set both the surface hidden portion and possibly
 its hidden contours (see `set contour`) as well as the hidden grid will be
 removed. Labels and arrows are always visible and are unaffected by this
 command.
 
 Each surface has its hidden part removed with respect to itself, if more
 than one surface is ploted. This mode is meaningfull when surfaces are
 plotted using line style drawing only.

 Syntax:
         set hidden3d
         set nohidden3d
         show hidden3d
3 isosamples
?set isosamples
?show isosamples
?isosamples
 An isoline is a curve parametrized by one of the surface parameters
 while the other surface parameter is fixed. Isolines are a simple
 means to display a surface. By fixing the u parameter of surface
 s(u,v), the iso-u lines of the form c(v) = s(u0,v) are produced, and
 by fixing the v parameter, the iso-v lines of the form c(u) = s(u,v0)
 are produced.
 
 The isoline density of surfaces may be changed by the `set isosamples`
 command. By default, sampling is set to 10 isolines per u or v axis.
 A higher sampling rate will produce more accurate plots, but will take
 longer. This parameter has no effect on data file plotting.
 
 Syntax:
         set isosamples <expression>
         show isosamples
3 key
?set key
?show key
?key
 The `set key` enables a key describing curves on a plot.  By default
 the key is placed in the upper right corner of the plot.
 
 Syntax:
         set key
         set key <x>,<y>{,<z>}
         set nokey
         show key
 
 The coordinates <x>, <y> (and <z> for `splot`s) specify the location
 of the key on the plot. The key is drawn as a sequence of lines, with
 one plot described on each line. On the right hand side of each line
 is a representation that attempts to mimic the way the curve is
 plotted.  On the left side of each line is the text description,
 obtained from the `plot` command. See `plot title` to change this
 description. The lines are vertically arranged so an imaginary
 straight line divides the left- and right-hand sides of the key. It is
 the coordinates of this line that are specified with the `set key`
 command. In a `plot`, only the x and y coordinates are used to specify
 the line position.  For a `splot`, x, y and z are all being used as a
 3-d location mapped using the same mapping as the plot itself to form
 the required 2-d screen position of the imaginary line.
 
 Some or all of the key may be outside of the plot boundary, although
 this may interfere with other labels and may cause an error on some
 devices.
 
 Examples:
 
 This places the key at the default location:
         set key
 This disables the key:
         set nokey
 This places a key at coordinates 2,3.5,2
         set key 2,3.5,2
3 label
?set label
?set nolabel
?show label
?label
?nolabel
 Arbitrary labels can be placed on the plot using the `set label`
 command.  If the z coordinate is given on a `plot` it is ignored; if
 it is missing on a `splot` it is assumed to be 0.
 
 Syntax:
 
          set label {<tag>} {"<label_text>"} {at <x>,<y>{,<z>}}
                            {<justification>}
          set nolabel {<tag>}
          show label
 
 
 The text defaults to "", and the position to 0,0,0.  The <x>, <y>, and
 <z> values are in the graph's coordinate system.  The tag is an
 integer that is used to identify the label. If no <tag> is given, the
 lowest unused tag value is assigned automatically. The tag can be used
 to delete or change a specific label. To change any attribute of an
 existing label, use the `set label` command with the appropriate tag,
 and specify the parts of the label to be changed.
 
 By default, the text is placed flush left against the point x,y,z.
 To adjust the way the label is positioned with respect to the point
 x,y,z, add the parameter <justification>, which may be `left`, `right`
 or `center`, indicating that the point is to be at the left, right or
 center of the text. Labels outside the plotted boundaries are
 permitted but may interfere with axes labels or other text.
 
 Examples:
 
 To set a label at (1,2) to "y=x" use:
          set label "y=x" at 1,2
 To set a label "y=x^2" with the right of the text at (2,3,4), and tag
 the label number 3, use:
          set label 3 "y=x^2" at 2,3,4 right
 To change the preceding label to center justification, use:
          set label 3 center
 To delete label number 2 use:
          set nolabel 2
 To delete all labels use:
          set nolabel
 To show all labels (in tag order) use:
          show label
 
 (The Latex, EEPIC, and Imagen drivers allow \\ in a string to specify
 a newline.)
3 logscale
?set logscale
?set nologscale
?show logscale
?logscale
?nologscale
 Log scaling may be set on the x, y, and z axes.
 
 Syntax:
         set logscale <axes>
         set nologscale <axes>
         show logscale
 
 where <axes> may be any combinations of `x`, `y`, and `z`, in any
 order.  If <axes> is not given then all three axes are assumed.  The
 command `set logscale` turns on log scaling on the specified axes,
 while `set nologscale` turns off log scaling.
 
 Examples:
 
 To enable log scaling in both x and z axes:
        set logscale xz
 To disable z axis log scaling:
        set nologscale z
3 mapping
?set mapping
?show mapping
?mapping
 
 Syntax:
         set mapping { cartesian | spherical | cylindrical }
 
 Data for `splot`s are usually in regular Euclidean space and are
 provided in Cartesian coordinates. Such 3-d data require three
 coordinates (x, y and z) or one coordinate (only z) in each line in
 the data file.  In order to be able to use spherical or cylindrical
 coordinate systems, use the `set mapping` command. In both cases two
 coordinates are expected in each line of the data. For a spherical
 coordinate system, these are theta and phi (in units as specified by
 `set angles`) and the mapping is:
 
         x = cos( theta ) * cos( phi )
         y = sin( theta ) * cos( phi )
         z = sin( phi )
 
 For a cylindrical coordinate system, the mapping uses two variables,
 theta (in units as specified by `set angles`) and z:
 
         x = cos( theta )
         y = sin( theta )
         z = z
 
 Again, note that mapping will affect data file `splot`s only.
3 offsets
?set offsets
?show offsets
?offsets
 The amount of the graph that the plot takes up may be controlled to
 some extent with the `set offsets` command. This command takes four
 offset arguments: <left>, <right>, <top> and <bottom>. By default,
 each offset is 0. Each offset may be a constant or an expression. Left
 and right offsets are given in units of the x axis, while top and
 bottom offsets are given in units of the y axis. The plot of sin(x),
 displayed with offsets of 0, 0, 2, 2 will take up 1/3 of the
 displayed y axis. Offsets are particularly useful with polar
 coordinates as a means of compensating for aspect ratio distortion.
 Offsets are ignored in `splot`s.
 
 Syntax:
         set offsets <left>, <right>, <top>, <bottom>
         show offsets
3 output
?set output
?show output
?output
 By default, plots are displayed to the standard output. The `set
 output` command redirects the display to the specified file or
 device.
 
 Syntax:
         set output {"<filename>"}
         show output
 
 The filename must be enclosed in quotes. If the filename is
 omitted, output will be sent to the standard output.

 On machines with popen functions (UNIX), output can be piped
 through a shell command if the first letter of the filename
 is '|'.  For instance,
 
 Syntax:
         set output "|lpr -Plaser filename"
         set output "|lp -dlaser filename"

 (On MSDOS machines, set output "prn" will direct the output
 to the default printer.)

3 parametric
?set parametric
?set noparametric
?show parametric
?parametric
?noparametric
 The `set parametric` command changes the meaning of `plot` (`splot`)
 from normal functions to parametric functions. The command
 `set noparametric` changes the plotting style back to normal,
 single-valued expression plotting.
 
 In 2-d plotting, a parametric function is determined by a pair
 of parametric functions operating on a parameter. An example
 of a 2-d parametric function would be plot sin(t),cos(t) (which
 defines a circle).
 
 For 3-d plotting, the surface is described as x=f(u,v), y=g(u,v),
 z=h(u,v). Therefore a triplet of functions are required. An example of
 3-d parametric function would be cos(u)*cos(v),cos(u)*sin(v),sin(u)
 (which defines a sphere). It takes three parametric function
 specifications in terms of the parametric dummy arguments to describe
 a single graph.
 
 The total set of possible plots is a superset of the simple f(x)
 style plots, since the two (three) functions can describe the
 x and y (and z) values to be computed separately. In fact,
 plots of the type t,f(t) (u,v,f(u,v)) are equivalent to those
 produced with f(x) when the x values are computed using the
 identity function as the first function.
 
 Note that the order the parametric functions are specified is
 xfunction, yfunction (and zfunction) and that each operates over the
 common parametric domain.
 
 Also, the `set parametric` function implies a new range of values.
 Whereas the normal f(x) and f(x,y) style plotting assume an xrange
 and yrange (and zrange), the parametric mode additionally specifies a
 trange, urange, and vrange. These ranges may be set
 directly with `set trange`, `set urange` and `set vrange`, or by
 specifying the range on the `plot` or `splot` commands. Currently
 the default range for these parametric variables is [-5:5].
 Setting the ranges to something more meaningful is expected.
3 polar
?set polar
?set nopolar
?show polar
?polar
?nopolar
 The `set polar` command changes the meaning of the plot from
 rectangular coordinates to polar coordinates. In polar coordinates,
 the dummy variable (x) is an angle. The range of this angle is changed
 from whatever it was to [0:2*pi], or, if degree unit has been selected,
 to [0:360] (see `set angles`).
 
 The command `set nopolar` changes the meaning of the plot back to the
 default rectangular coordinate system. The range of x is changed from
 whatever it was to [-10:10].
 
 The `set polar` command is not supported for `splot`s.  See the
 `set mapping` command for similar functionality for `splot`s.
 
 While in polar coordinates the meaning of an expression in x is really
 r = f(x), where x is an angle of rotation. The xrange controls the
 domain (the angle) of the function, and the yrange controls the range
 (the radius). The plot is plotted in a rectangular box, and the x and
 y axes are both in units of the radius. Thus, the yrange controls both
 dimensions of the plot output. The tics and units are written along
 the axes rather than at the left and bottom. These unit are offset by
 <rmin> specified by the `rrange` (See `set rrange`). It is not
 possible to specify different output dimensions in the x or y
 directions. The yrange can be used to shift the plot diagonally to
 display only the first or third quadrants.
 
 Syntax:
         set polar
         set nopolar
         show polar
 Example:
         set polar
         plot x*sin(x)
         plot [-2*pi:2*pi] [-3:3] x*sin(x)
 The first plot uses the default polar angular domain of 0 to 2*pi.
 The radius (and the size of the plot) is scaled automatically. The
 second plot expands the domain, and restricts the range of the radius
 (and the size of the plot) to [-3:3].
3 rrange
?set rrange
?show rrange
?rrange
 The `set rrange` command sets the radial range used to compute x and y
 values when in polar mode. If not in polar mode (see `set polar`) then
 this range is not used. Use of this command offsets the polar
 singularity to the <rmin> value and shifts the units on the axes tic
 marks. For instance, `set rrange [-40:40]` would set the origin to -40
 and would plot values of radial values between -40 to 40. Thus, if
 360 degrees of data were plotted, then the plot would extend 80 units
 in radially from the origin.  To view the entire plot,  a 
 `set yrange [-80:80]` command would create a square viewport with
 a circular plot tangent at the axes.  Because `xrange` is used
 specify the angular extent, only a square viewport can be specified
 by `yrange`.  For instance, `set yrange [0:80]` would display the
 first quadrant and `set yrange [-80:0]` would display the third
 quadrant.  Any square viewport of any size can be specified but it
 is constrained to be centered on a 45 degree line.
 
 This range may also be specified on the `plot` command line when in
 polar mode.
 
 Syntax:
         set rrange [{<rmin> : <rmax>}]
 
 where <rmin> and <rmax> terms are constants or expressions.
 
 Both the <rmin> and <rmax> terms are optional. Anything omitted will
 not be changed, so 
         set rrange [:10]
 changes rmax to 10 without affecting rmin.
3 samples
?set samples
?show samples
?samples
 The sampling rate of functions may be changed by the `set samples`
 command. By default, sampling is set to 100 points. A higher sampling
 rate will produce more accurate plots, but will take longer. This
 parameter no longer has any effect on data-file plotting.
 
 Syntax:
         set samples <expression>
         show samples
3 size
?set size
?show size
?size
 The `set size` command scales the displayed size of the plot.  On some
 terminals, changing the size of the plot will result in text being
 misplaced. Increasing the size of the plot may produce strange
 results. Decreasing is safer.
 
 Syntax:
 
         set size {<xscale>,<yscale>}
         show size
 
 The <xscale> and <yscale> values are the scaling factors for the size.
 The defaults (1,1) are selected if the scaling factors are omitted.
 
 Examples: 
 
 To set the size to normal size use:
         set size
 To make the plot half size use:
         set size 0.5,0.5
 To make a landscape plot have a 1:1 aspect ratio in polar mode use:
         set size 0.721,1.0
 To show the size use:
         show size
 
 For the LaTeX and Fig terminals the default size (scale factor 1,1)
 is 5 inches wide by 3 inches high. The big Fig terminal (`bfig`) is 7
 inches wide by 5 inches high. The postscript default is landscape mode
 10 inches wide and 7 inches high. 
 Note that the size of the plot includes the space used by the labels; 
 the plotting area itself is smaller. 
3 style
?set style
?show style
?style
 Plots may be displayed in one of six styles: `lines`, `points`,
 `linespoints`, `impulses`, `dots`, or `errorbars`. The `lines` style
 connects adjacent points with lines. The `points` style displays a
 small symbol at each point. The `linespoints` style does both
 `lines` and `points`. The `impulses` style displays a vertical line
 from the x axis to each point. The `dots` style plots a tiny dot at
 each data point; this is useful for scatter plots with many points.
 
 The `errorbars` style is relevant only for to data file `plot`s. It is
 treated like `points` for function `plot`s and `splot`s. For data file
 `plot`s, `errorbars` is like `points`, except that a vertical error
 bar is also drawn: for each point (x,y), a line is drawn from (x,ylow)
 to (x,yhigh). A tic mark is placed at the ends of the error bar. The
 ylow and yhigh values are read from the data file's third and fourth
 columns, or as specified with the `using` option to plot.  See `plot
 errorbars` for more information.
 
 Default styles are chosen with the `set function style` and `set
 data style` commands. See `plot style` for information about how
 to override the default plotting style for individual functions.
 
 Syntax:
         set function style <style>
         set data style <style>
         show function style
         show data style
 
 where <style> is `lines`, `points`, `linespoints`, `impulses`,
 `dots`, or `errorbars`.
3 surface
?set surface
?set nosurface
?show surface
?surface
 `set surface` controls the display of surfaces. It is useful if
 contours are to be displayed by themselves. Whenever `set nosurface`
 is issued, no surface isolines/mesh will be drawn. See also `set
 contour`.
 
 Syntax:
         set surface
         set nosurface
         show surface
3 terminal
?set terminal
?show terminal
?terminal
 GNUPLOT supports many different graphics devices. Use the `set
 terminal` command to select the type of device for which GNUPLOT
 will produce output.
 
 Syntax:
         set terminal {<terminal-type>}
         show terminal
 
 If <terminal-type> is omitted, GNUPLOT will list the available
 terminal types. <terminal-type> may be abbreviated.
 
 Use `set output` to redirect this output to a file or device.

 Several terminals have additional options. For example, see `dumb`,
 `iris4d`, `hpljii` or `postscript`.
4 dumb
?set terminal dumb
?dumb
 The dumb terminal driver has an optional size specification.

 Syntax:
         set terminal dumb {<xsize> <ysize>}

 where <xsize> and <ysize> set the size of the dumb terminals. Default
 is 79 by 24.

 Examples:
         set term dumb
         set term dumb 79 49 #(VGA screen - why would anyone want to do that!?)
 
4 hpljii
?set terminal hpljii
?hpljii
 The HP LaserJet II and HP DeskJet drivers have a single option.

 Syntax:
         set terminal hpljii {<resolution>}
         set terminal hpdj   {<resolution>}

 where <resolution> is the resolution of the output in dots per inch.
 It must be `75`, `100`, `150` or `300`.

 Example:
         set terminal hpljii 150
 
4 iris4d
?set terminal iris4d
?iris4d
 The iris4d driver can operate in two modes.

 Syntax:
         set terminal iris4d {24}

 If the hardware supports only 8 bits, use the default `set terminal
 iris4d`. If, however, the hardware supports 24 bits (8 per
 red/green/blue), use `set terminal iris4d 24`.

 When using 24-bit mode, the colors can be directly specified via the
 file .gnuplot_iris4d that is searched in the current directory and
 then in the home directory specified by the HOME environment variable.
 This file holds RGB values for the background, border, labels and nine
 plotting colors, in that order. For example, here is a file containing
 the default colors:
 
         85   85   85     /* Back Ground */
         0    0    0      /* Boundary */
         170  0    170    /* Labeling */
         85   255  255    /* Plot Color 1 */
         170  0    0      /* Plot Color 2 */
         0    170  0      /* Plot Color 3 */
         255  85   255    /* Plot Color 4 */
         255  255  85     /* Plot Color 5 */
         255  85   85     /* Plot Color 6 */
         85   255  85     /* Plot Color 7 */
         0    170  170    /* Plot Color 8 */
         170  170  0      /* Plot Color 9 */
 
 This file has exactly 12 lines of RGB triples. No empty lines are
 allowed and anything after the third number in line is ignored.
 
4 pbm
?set terminal pbm
?pbm
 Several options may be set in the PBMplus driver.

 Syntax:
         set terminal pbm {<fontsize>}
         set terminal pgm {<fontsize>}
         set terminal ppm {<fontsize>}

 where <fontsize> is `small`, `medium`, or `large`. 
 Default size is 640 pixels wide and 480 pixels high.
 The pbm output is a portable bitmap (one bit per pixel).
 The pgm output is a portable graymap (three bits per pixel). 	
 The ppm output is a portable pixmap (color, four bits per pixel).
 The output of these drivers can be used with Jef Poskanzer's 
 excellent PBMPLUS package which provides programs to convert
 the above PBMPLUS formats to GIF, TIFF, MacPaint, Macintosh PICT,
 PCX, X11 bitmap and many others. 

 Examples:
 
         set term pbm small
         set size 2,2
         set term ppm medium
 
4 postscript
?set terminal postscript
?postscript
 Several options may be set in the PostScript driver.

 Syntax:
         set terminal postscript {<mode>} {<color>}
                                 {"<fontname>"} {<fontsize>}

 where <mode> is `landscape`, `portrait`, `eps` or `default`. 
 Selecting default sets all options to their defaults.
 <color> is either `color` or `monochrome`.
 "<fontname>" is the name of a valid PostScript font.
 <fontsize> is the size of the font in PostScript points, before 
 scaling by the `set size` command.
 Defaults are `landscape`, `monochrome`, "Courier", and 14pt.
 Default size of PostScript plot is landscape mode 10 inches wide 
 and 7 inches high.

 To get EPS output, use the `eps` mode and make only one plot per file.
 In `eps` mode the whole plot is halved in size; the fonts are half the 
 given size, and the plot is 5 inches wide and 3.5 inches high.

 Examples:
 
         set term postscript default       # old postscript
         set term postscript landscape 22  # old psbig
         set term postscript eps 14   # old epsf1
         set term postscript eps 22   # old epsf2
         set size 0.7,1.4
         set term post portrait color "Times-Roman" 14 
 
4 aifm
?set terminal aifm
?aifm
 Several options may be set in the Adobe Illustrator 3.0 driver.

 Syntax:
         set terminal aifm {<color>}
                                 {"<fontname>"} {<fontsize>}

 Selecting default sets all options to their defaults.
 <color> is either `color` or `monochrome`.
 "<fontname>" is the name of a valid PostScript font.
 <fontsize> is the size of the font in PostScript points, before 
 scaling by the `set size` command.
 Defaults are `monochrome`, "Courier", and 14pt.

 Also, since AI does not really support multiple pages, multiple 
 graphs will be output directly on one another.  However, each graph 
 will be grouped individually, making it easy to separate them inside 
 AI (just pick them up and move them).

 Examples:
 
         set term aifm 
         set term aifm 22  
         set size 0.7,1.4
         set term aifm color "Times-Roman" 14 
 
4 table
?set terminal table
?table
 Instead of producing a picture, term type 'table' prints out
 the evaluation results in a multicolumn ASCII table of X Y Z values.
 For those times when you really want to see the numbers, now you
 can see them on the screen or save to a file.

3 tics
?set tics
?show tics
?tics
 By default, tics are drawn inwards from the border on all four sides.
 The `set tics` command can be used to change the tics to be 
 drawn outwards on the left and bottom borders only.
 This is useful when doing impulse plots.
 
 Syntax:
         set tics {<direction>}
         show tics
 
 where <direction> may be `in` or `out`. `set tics` defaults to `in`.
 
 See also the `set xtics`, `set ytics`, and `set ztics` command for more
 control of tic marks.
?set ticslevel
?show ticslevel
?ticslevel
 Using splot, in 3-d plots, one can adjust the relative height of the
 vertical (Z) axis using `set ticslevel`. The numeric argument provided
 specifies the location of the bottom of the scale. a zero will put it
 on the bottom grid and any positive number somewhere along the z axis.
 
 Syntax:
         set ticslevel {<level>}
         show tics
 
 where <level> is a non negative numeric argument. For example,

         set ticslevel 0.5

 sets the tics level to the default value.
 
 See also the `set view`.
3 time
?set time
?show time
?time
 The optional `set time` places the time and date of the plot either
 at the top or bottom of the left margin. The exact location is
 device dependent.
 
 Syntax:
         set time {<xoff>}{,<yoff>}
         set notime
         show time
 
 Specifying constants <xoff> or <yoff> as optional offsets for the time
 will move the time <xoff> or <yoff> character screen coordinates. For
 example,
 
         set time ,-3
 
 will change only the y offset of the time, moving the title down by
 roughly the height of three characters.
 
3 title
?set title
?show title
?title
 The `set title` command produces a plot title that is centered at the
 top of the plot. Using the optional x,y screen offsets, the title
 can be placed anywhere on the plot. `set title` with no parameters
 clears the title.
 
 Syntax:
          set title {"<title-text>"} {<xoff>}{,<yoff>}
          show title
 
 Specifying constants <xoff> or <yoff> as optional offsets for the
 title will move the title <xoff> or <yoff> character screen
 coordinates. Note these are screen coordinates and not plot
 coordinates. For example,
 
          set title ,-1
 
 will change only the y offset of the title, moving the title down by
 roughly the height of one character.
 
 (The Latex, EEPIC, and Imagen drivers allow \\ in a string to specify
 a newline.)
3 trange
?set trange
?show trange
?trange
 The `set trange` command sets the parametric range used to compute
 x and y values when in parametric mode. If not in parametric mode
 (see `set parametric`) then this range is not used. This command
 does not affect x/y autoscaling or x/y ranges.
 
 This range may also be specified on the `plot` command line when
 in parametric mode.
 
 Syntax:
         set trange [{<tmin> : <tmax>}]
 
 where <tmin> and <tmax> terms are constants or expressions.
 
 Both the <tmin> and <tmax> terms are optional. Anything omitted will
 not be changed, so 
         set trange [:10]
 changes tmax to 10 without affecting tmin.  See also `set urange` and
 `set parametric`.
3 urange
?set urange
?show urange
?urange
 The `set urange` and `set vrange` commands sets the parametric ranges used 
 to compute x, y, and z values when in `splot` parametric mode. If not in 
 parametric mode (see `set parametric`) then these ranges are not used. This 
 command does not affect x/y autoscaling or x/y ranges.
 
 This range may also be specified on the `splot` command line when
 in parametric mode.  See `plot` for more information
 
 Syntax:
         set urange [{<umin> : <umax>}]
 
 where <umin> and <umax> terms are constants or expressions.
 
 Both the <umin> and <umax> terms are optional. Anything omitted will
 not be changed, so 
         set urange [:10]
 changes umax to 10 without affecting umin.  See also `set trange`.
3 variables
?show variables
 The `show variables` command lists all user-defined variables and
 their values.
 
 Syntax:
         show variables
3 view
?set view
?show view
?view
 The `set view` command sets the view point for `splot`s. This
 command controls the way the 3-d coordinates of the plot are mapped
 into the 2-d screen space. This command provides controls to both
 rotation and scaling of the plotted data but supports orthographic
 projections only.
 
 Syntax:
         set view <rot_x> {,{<rot_z>}{,{<scale>}{,<scale_z>}}}
         show view
 
 where <rot_x> and <rot_z> control the rotation angles (in degrees)
 along a virtual 3-d coordinate system aligned with the screen such
 that the screen horizontal axis is x, screen vertical axis is y, and
 the axis perpendicular to the screen is z. <rot_x> is bounded to the
 [0:180] range with a default of 60 degrees, while <rot_z> is bounded
 to the [0:360] range with a default of 30 degrees. <scale> controls
 the scaling of the entire `splot`, while <scale_z> scales the z axis
 only. Both scales default to 1.0.
 
 Examples:
         set view 60, 30, 1, 1
         set view ,,0.5
 
 The first sets all the four default values. The second changes 
 only scale, to 0.5.

 See also `set ticslevel`.
3 vrange
?set vrange
?show vrange
?vrange
 The `set vrange` command is similar to the `set urange` command.
 Please see `set urange`.
3 xlabel
?set xlabel
?show xlabel
?xlabel
 The `set xlabel` command sets the x-axis label that is centered along
 the x axis. Using the optional x,y screen offsets, the label can be
 placed anywhere on the plot. `set xlabel` with no parameters clears
 the label.
 
 Syntax: 
          set xlabel {"<label>"} {<xoff>}{,<yoff>}
          show xlabel
 
 Specifying constants <xoff> or <yoff> as optional offsets for the
 label will move the label <xoff> or <yoff> character screen
 coordinates. For example,
 
          set xlabel -1
 
 will change only the x offset of the xlabel, moving the label roughly
 one character width to the left.
 
 (The LaTeX, EEPIC, and Imagen drivers allow \\ in a string to specify
 a newline.)
3 xrange
?set xrange
?show xrange
?xrange
 The `set xrange` command sets the horizontal range that will be
 displayed. This command turns x axis autoscaling off.
 
 This range may also be specified on the `plot` command line.
 
 Syntax:
         set xrange [{<xmin> : <xmax>}]
 
 where <xmin> and <xmax> terms are constants or expressions.
 
 Both the <xmin> and <xmax> terms are optional. Anything omitted will
 not be changed, so 
         set xrange [:10]
 changes xmax to 10 without affecting xmin.
3 xtics
?set xtics
?set noxtics
?show xtics
?xtics
?noxtics
 Fine control of the x axis tic marks is possible with the
 `set xtics` command. The x-axis tic marks may be turned off with the
 `set noxtics` command. They may be turned on (the default state) with
 `set xtics`.
 
 Syntax:
          set xtics { {<start>, <incr>{, <end>}} |
                      {({"<label>"} <pos> {, {"<label>"} <pos>}...)} }
          set noxtics
          show xtics

 The <start>, <incr>, <end> form specifies that a series of tics will
 be plotted on the x axis between the x values <start> and <end>
 with an increment of <incr>. If <end> is not given it is assumed to be
 infinity. The increment may be negative. For example,
           set xtics 0,.5,10
 makes tics at 0, 0.5, 1, 1.5, ..., 9.5, 10.
 
 The ("<label>" <pos>, ...) form allows arbitrary tic positions or
 non-numeric tic labels. A set of tics are a set of positions, each
 with its own optional label. Note that the label is a string enclosed
 by quotes, and may be a constant string, such as "hello", or contain
 formatting information for the tic number (which is the same as the
 position), such as "%3f clients". See `set format` for more
 information about this case. The label may even be empty.
 Examples:
          set xtics ("low" 0, "medium" 50, "high" 100)
          set xtics (1,2,4,8,16,32,64,128,256,512,1024)
          set xtics ("bottom" 0, "" 10, "top" 20)
 
 Tics will only be plotted when in range.
 
 The `set ytics` and `set noytics` commands work identically.
 See also the `set format` command.
3 xzeroaxis
?set xzeroaxis
?set noxzeroaxis
?show xzeroaxis
?xzeroaxis
?noxzeroaxis
 `set xzeroaxis` draws the x-axis. By default, this option is on.
 `set noxzeroaxis` causes GNUPLOT to omit the x-axis.
 
 Syntax:
         set xzeroaxis
         set noxzeroaxis
         show xzeroaxis
3 ylabel
?set ylabel
?show ylabel
?ylabel
 The `set ylabel` command sets the y-axis label.  The position of this
 label depends on the terminal, and can be one of the following three
 positions (the position can be adjusted with optional parameters).
 
 1. Horizontal text flushed left at the top left of the plot.
 Terminals that cannot rotate text will probably use this method.
 
 2. Vertical text centered vertically at the left of the plot.
 Terminals that can rotate text will probably use this method.
 
 3. Horizontal text centered vertically at the left of the plot.
 The LaTeX and EEPIC drivers use this method. The user must insert 
 line breaks using \\ to prevent the ylabel from overwriting
 the plot. To produce a vertical row of characters, add \\
 between every printing character (but this is ugly).
 
 Syntax:  
          set ylabel {"<label>"} {<xoff>}{,<yoff>}
          show ylabel
 
 With no parameters, the label is cleared. Specifying constants <xoff>
 or <yoff> as optional offsets for the label will move the label <xoff>
 or <yoff> character screen coordinates. For example,
 
          set ylabel -1
 
 will change only the x offset of the ylabel, moving the label roughly
 one character width left of its default position. This is especially
 useful with the LaTeX driver.
 
 (The LaTeX, EEPIC, and Imagen drivers allow \\ in a string to specify
 a newline.)
3 yrange
?set yrange
?show yrange
?yrange
 The `set yrange` command sets the vertical range that will be
 displayed. This command turns y axis autoscaling off.
 
 This range may also be specified on the `plot` command line.
 
 Syntax:
         set yrange [{<ymin> : <ymax>}]
 
 where <ymin> and <ymax> terms are constants or expressions.
 
 Both the <ymin> and <ymax> terms are optional. Anything omitted will
 not be changed, so 
         set yrange [:10]
 changes ymax to 10 without affecting ymin.
3 ytics
?set ytics
?set noytics
?show ytics
?ytics
?noytics
 The `set ytics` and `set noytics` commands are similar to the `set xtics`
 and `set noxtics` commands. Please see `set xtics`.
3 yzeroaxis
?set yzeroaxis
?set noyzeroaxis
?show yzeroaxis
?yzeroaxis
?noyzeroaxis
 `set yzeroaxis` draws the y-axis. By default, this option is on.
 `set noyzeroaxis` causes GNUPLOT to omit the y-axis.
 
 Syntax:
         set yzeroaxis
         set noyzeroaxis
         show yzeroaxis
3 zero
?set zero
?show zero
?zero
 The `zero` value is the default threshold for values approaching 0.0.
 GNUPLOT will not plot a point if its imaginary part is greater in
 magnitude than the `zero` threshold. Axis ranges cannot be less than
 `zero`. The default `zero` value is 1e-8. This can be changed with
 the `set zero` command.

 Syntax:
         set zero <expression>
         show zero
3 zeroaxis
?set zeroaxis
?set nozeroaxis
?show zeroaxis
?zeroaxis
?nozeroaxis
 `set zeroaxis` draws the x-axis and y-axis. By default, this option is
 on.  `set nozeroaxis` causes GNUPLOT to omit the axes, and is
 equivalent to `set noxzeroaxis; set noyzeroaxis.`
 
 Syntax:
         set zeroaxis
         set nozeroaxis
         show zeroaxis
 See `set xzeroaxis` and `set yzeroaxis`.
3 zlabel
?set zlabel
?show zlabel
?zlabel
 The `set zlabel` command sets the z-axis label that is centered along
 the z axis. Using the optional x,y screen offsets, the label can be
 placed anywhere on the plot. `set zlabel` with no parameters clears
 the label.
 
 Syntax: 
          set zlabel {"<label>"} {<xoff>}{,<yoff>}
          show zlabel
 
 Specifying constants <xoff> or <yoff> as optional offsets for the
 label will move the label <xoff> or <yoff> character screen
 coordinates. For example,
 
          set zlabel ,1
 
 will change only the y offset of the zlabel, moving the label roughly
 one character height up.
 
 The zlabel will be drawn whenever surfaces or contours are plotted,
 in the space above the grid level.
 
 (The LaTeX, EEPIC, and Imagen drivers allow \\ in a string to specify
 a newline.)
3 zrange
?set zrange
?show zrange
?zrange
 The `set zrange` command sets the vertical range that will be
 displayed. This command turns z axis autoscaling off.  The zrange is
 used only by `splot` and is ignored by `plot`.
 
 This range may also be specified on the `splot` command line.
 
 Syntax:
         set zrange [{<zmin> : <zmax>}]
 
 where <zmin> and <zmax> terms are constants or expressions.
 
 Both the <zmin> and <zmax> terms are optional. Anything omitted will
 not be changed, so
         set zrange [2:]
 changes zmin to 2 without affecting zmax.
3 ztics
?set ztics
?set noztics
?show ztics
?ztics
?noztics
 The `set ztics` and `set noztics` commands are similar to the `set
 xtics` and `set noxtics` commands. Please see `set xtics`.
2 shell
?shell
 The `shell` command spawns an interactive shell. To return to
 GNUPLOT, type `logout` if using VMS, `exit` or the END-OF-FILE
 character if using Unix, `endcli` if using AmigaDOS, or `exit` if
 using MS-DOS.
 
 A single shell command may be spawned by preceding it with the !
 character ($ if using VMS) at the beginning of a command line.
 Control will return immediately to GNUPLOT after this command is
 executed. For example, in VMS, AmigaDOS, or MS-DOS,
 
      ! dir
 
 prints a directory listing and then returns to GNUPLOT.
2 splot
 Three-dimensional surface and contour plotting is available in
 GNUPLOT with the `splot` command. See the `plot` command for features
 common to the `plot` command.
 
 See also `set contour`, `set cntrparam`, and `set surface`.
2 start-up
?startup
?start
?.gnuplot
 When GNUPLOT is run, it looks for an initialization file to load.
 This file is called `.gnuplot` on Unix and AmigaDOS systems, and
 `GNUPLOT.INI` on other systems. If this file is not found in the
 current directory, the program will look for it in the home directory
 (under AmigaDOS and MS-DOS, the environment variable GNUPLOT should
 contain the name of this directory).
 
 If this file is found, GNUPLOT executes the commands in this file.
 This is most useful for setting the terminal type and defining any
 functions or variables that are used often.
2 substitution
?substitution
 Command-line substitution is specified by a system command enclosed in
 backquotes. This command is spawned and the output it produces
 replaces the name of the command (and backquotes) on the command line.
 
 Newlines in the output produced by the spawned command are replaced
 with blanks.
 
 Command-line substitution can be used anywhere on the GNUPLOT command
 line.
 
 Example:
 
 This will run the program `leastsq` and replace `leastsq` (including
 backquotes) on the command line with its output:
 
          f(x) = `leastsq`
 
 or, in VMS
 
          f(x) = `run leastsq`
2 user-defined
?userdefined
?variables
 New user-defined variables and functions of one or two variables may be 
 declared and used anywhere.
 
 User-defined function syntax:
         <function-name> ( <dummy-var1> {,<dummy-var2>} ) =  <expression>
 
 where <expression> is defined in terms of <dummy-var1> and <dummy-var2>.

 User-defined variable syntax:
         <variable-name> = <constant-expression>
 
 Examples:
         w = 2
         q = floor(tan(pi/2 - 0.1))
         f(x) = sin(w*x)
         sinc(x) = sin(pi*x)/(pi*x)
         delta(t) = (t == 0)
         ramp(t) = (t > 0) ? t : 0
         min(a,b) = (a < b) ? a : b
         comb(n,k) = n!/(k!*(n-k)!)
 
 Note that the variable `pi` is already defined.
 
 See `show functions` and `show variables`.
2 bugs
?bugs
 The bessel functions do not work for complex arguments.
 
 The gamma function does not work for complex arguments.
 
 There is a bug in the stdio library for old Sun operating systems
 (SunOS Sys4-3.2). The "%g" format for 'printf' sometimes incorrectly
 prints numbers (e.g., 200000.0 as "2"). Thus, tic mark labels may be
 incorrect on a Sun4 version of GNUPLOT. A work-around is to rescale
 the data or use the `set format` command to change the tic mark format
 to "%7.0f" or some other appropriate format. This appears to have been
 fixed in SunOS 4.0.
 
 Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2
 and SunOS 4.0, the 'sscanf' routine incorrectly parses "00 12" with
 the format "%f %f" and reads 0 and 0 instead of 0 and 12. This
 affects data input. If the data file contains x coordinates that are
 zero but are specified like '00', '000', etc, then you will read the
 wrong y values. Check any data files or upgrade the SunOS.
 It appears to have been fixed in SunOS 4.1.1.
 
 Microsoft C 5.1 has a nasty bug associated with the %g format for
 printf. When any of the formats "%.2g", "%.1g", "%.0g", "%.g" are
 used, printf will incorrectly print numbers in the range 1e-4 to 1e-1.
 Numbers that should be printed in the %e format are incorrectly 
 printed in the %f format, with the wrong number of zeros after the 
 decimal point.

 To work around this problem, use the %e or %f formats explicitly.
 
 GNUPLOT, when compiled with Microsoft C, did not work correctly on two
 VGA displays that were tested. The CGA, EGA and VGA drivers should 
 probably be rewritten to use the Microsoft C graphics library.
 GNUPLOT compiled with Turbo C uses the Turbo C graphics drivers and 
 does work correctly with VGA displays.
 
 VAX/VMS 4.7 C compiler release 2.4 also has a poorly implemented %g 
 format for printf. The numbers are printed numerically correct, but 
 may not be in the requested format. The K&R second edition says that 
 for the %g format, %e is used if the exponent is less than -4 or greater 
 than or equal to the precision. The VAX uses %e format if the exponent 
 is less than -1. The VAX appears to take no notice of the precision 
 when deciding whether to use %e or %f for numbers less than 1.
 To work around this problem, use the %e or %f formats explicitly.
 From the VAX C 2.4 release notes:
 e,E,f,F,g,G  Result will always contain a decimal  point.
 For g and G, trailing zeros will not be removed from the result.
 
 VAX/VMS 5.2 C compiler release 3.0 has a slightly better implemented
 %g format than release 2.4, but not much. Trailing decimal points are 
 now removed, but trailing zeros are still not removed from %g numbers 
 in exponential format.

 ULTRIX X11R3 has a bug that causes the X11 driver to display "every
 other" plot.  The bug seems to be fixed in DEC's release of X11R4 so
 newer releases of ULTRIX don't seem to have the problem.  Solutions for 
 older sites include upgrading the X11 libraries (from DEC or direct from 
 MIT) or defining ULTRIX_KLUDGE when compiling the x11.trm file.  Note 
 that the kludge is not an ideal fix, however.

 The constant HUGE was incorrectly defined in the NeXT OS 2.0 operating
 system.  HUGE should be set to 1e38 in plot.h. This error has been
 corrected in the 2.1 version of NeXT OS.

 Some older models of HP plotters do not have a page eject command 'PG'.
 The current HPGL driver uses this command in HPGL_reset.  This may need
 to be removed for these plotters.  The current PCL5 driver uses HPGL/2
 for text as well as graphics.  This should be modified to use scalable
 PCL fonts.

 Please report any bugs to bug-gnuplot@ames.arc.nasa.gov.
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted r34.1/plot/docs/gnuplot.gih version [192e5dd2b9].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
?
 GNUPLOT is a command-driven interactive function plotting program. It
 is case sensitive (commands and function names written in lowercase
 are not the same as those written in CAPS). All command names may be
 abbreviated, as long as the abbreviation is not ambiguous. Any number
 of commands may appear on a line, separated by semicolons (;).
 Strings are indicated with quotes.  They may be either single or double
 quotation marks, e.g.,

          load "filename"
          cd 'dir'
 
 Any command-line arguments are assumed to be names of files containing 
 GNUPLOT commands, with the exception of standard X11 arguments, which
 are processed first. Each file is loaded with the `load` command, in the
 order specified. GNUPLOT exits after the last file is processed.  When
 no load files are named, gnuplot enters into an interactive mode.
 
 Commands may extend over several input lines, by ending each 
 line but the last with a backslash (\). The backslash must be the LAST
 character on each line. The effect is as if the backslash and newline
 were not there. That is, no white space is implied, nor is a comment
 terminated. Therefore, commenting out a continued line comments out
 the entire command (see `comment`).
 
 In this documentation, curly braces ({}) denote optional arguments to
 many commands, and a vertical bar (|) separates mutually exclusive
 choices.  GNUPLOT keywords or help topics are indicated by backquotes
 or `boldface` (where available).  Angle brackets (<>) are used to mark
 replaceable tokens.
 
 For help on any topic, type `help` followed by the name of the topic.

 The new GNUPLOT user should begin by reading about the `plot`
 command (type `help plot`).
?cd
 The `cd` command changes the working directory.
 
 Syntax:
         cd "<directory-name>"
 
 The directory name must be enclosed in quotes.
 
 Examples:
         cd 'subdir'
         cd ".."
?clear
 The `clear` command erases the current screen or output device as
 specified by `set output`. This usually generates a formfeed on
 hardcopy devices. Use `set terminal` to set the device type.
?line-editing
?editing
?history
 The Unix and IBM PC versions of GNUPLOT support command-line editing.
 Also, a history mechanism allows previous commands to be edited, and
 re-executed. After the command line has been edited, a newline or
 carriage return will enter the entire line regardless of where the
 cursor is positioned.

 The editing commands are as follows:
 
 `Line editing`:
 
 ^B moves back a single character.
 ^F moves forward a single character.
 ^A moves to the beginning of the line.
 ^E moves to the end of the line.
 ^H and DEL delete the previous character.
 ^D deletes the current character.
 ^K deletes from current position to the end of line.
 ^L,^R redraws line in case it gets trashed.
 ^U deletes the entire line.
 ^W deletes the last word.

 `History`:
 
 ^P moves back through history.
 ^N moves forward through history.

 On the IBM PC the use of a TSR program such as DOSEDIT or CED may be
 desired for line editing. For such a case GNUPLOT may be compiled with
 no line editing capability (default makefile setup). Set READLINE in the
 makefile and add readline.obj to the link file if GNUPLOT line editing
 is to be used for the IBM PC. The following arrow keys may be used
 on the IBM PC version if readline is used:
 
 Left  Arrow     - same as ^B.
 Right Arrow     - same as ^F.
 Ctl Left  Arrow - same as ^A.
 Ctl Right Arrow - same as ^E.
 Up    Arrow     - same as ^P.
 Down  Arrow     - same as ^N.
 (The readline function in gnuplot is not the same as the readline used
 in GNU BASH and GNU EMACS.  It is somewhat compatible however.) 
?comments
 Comments are supported as follows: a # may appear in most places in a line
 and GNUPLOT will ignore the rest of the line. It will not have this
 effect inside quotes, inside numbers (including complex numbers), inside
 command substitutions, etc. In short, it works anywhere it makes sense
 to work.
?environment
 A number of shell environment variables are understood by GNUPLOT.
 None of these are required, but may be useful.
 
 If GNUTERM is defined, it is used as the name of the terminal type to
 be used. This overrides any terminal type sensed by GNUPLOT on start
 up, but is itself overridden by the .gnuplot (or equivalent) start-up
 file (see `start-up`), and of course by later explicit changes.
 
 On Unix, AmigaDOS, and MS-DOS, GNUHELP may be defined to be the pathname
 of the HELP file (gnuplot.gih).

 On VMS, the symbol GNUPLOT$HELP should be defined as the name of 
 the help library for GNUPLOT.
 
 On Unix, HOME is used as the name of a directory to search for 
 a .gnuplot file if none is found in the current directory.
 On AmigaDOS and MS-DOS, GNUPLOT is used. On VMS, SYS$LOGIN: is used.
 See help start-up.
 
 On Unix, PAGER is used as an output filter for help messages.
 
 On Unix and AmigaDOS, SHELL is used for the `shell` command. On MS-DOS,
 COMSPEC is used for the `shell` command.

 On AmigaDOS, GNUFONT is used for the screen font.  For example:
 "setenv GNUFONT sapphire/14".

 On MS-DOS, if the BGI interface is used, the variable `BGI` is used to point 
 to the full path to the BGI drivers directory. Furthermore SVGA is used to
 name the Super VGA BGI driver in 800x600 res., and its mode of operation
 as 'Name.Mode'.
 For example, if the Super VGA driver is C:\TC\BGI\SVGADRV.BGI and mode 3 is
 used for 800x600 res., then: 'set BGI=C:\TC\BGI' and 'set SVGA=SVGADRV.3'.
?exit
?quit
 The commands `exit` and `quit` and the END-OF-FILE character
 will exit GNUPLOT. All these commands will clear the output device
 (as the `clear` command does) before exiting.
?expressions
 In general, any mathematical expression accepted by C, FORTRAN,
 Pascal, or BASIC is valid. The precedence of these operators is
 determined by the specifications of the C programming language.
 White space (spaces and tabs) is ignored inside expressions.
 
 Complex constants may be expressed as the {<real>,<imag>}, where <real>
 and <imag> must be numerical constants. For example, {3,2}
 represents 3 + 2i; {0,1} represents `i` itself. The curly braces 
 are explicitly required here.
?expressions functions
?functions
 The functions in GNUPLOT are the same as the corresponding functions
 in the Unix math library, except that all functions accept integer,
 real, and complex arguments, unless otherwise noted. The `sgn`
 function is also supported, as in BASIC.
?expressions functions abs
?functions abs
?abs
 The `abs` function returns the absolute value of its argument. The
 returned value is of the same type as the argument.
 
 For complex arguments, abs(x) is defined as the length of x in the
 complex plane [i.e.,  sqrt(real(x)**2 + imag(x)**2) ].
?expressions functions acos
?functions acos
?acos
 The `acos` function returns the arc cosine (inverse cosine) of its
 argument. `acos` returns its argument in radians.
?expressions functions arg
?functions arg
?arg
 The `arg` function returns the phase of a complex number, in radians.
?expressions functions asin
?functions asin
?asin
 The `asin` function returns the arc sin (inverse sin) of its argument.
 `asin` returns its argument in radians.
?expressions functions atan
?functions atan
?atan
 The `atan` function returns the arc tangent (inverse tangent) of its
 argument. `atan` returns its argument in radians.
?expressions functions besj0
?functions besj0
?besj0
 The `besj0` function returns the j0th Bessel function of its argument.
 `besj0` expects its argument to be in radians.
?expressions functions besj1
?functions besj1
?besj1
 The `besj1` function returns the j1st Bessel function of its argument.
 `besj1` expects its argument to be in radians.
?expressions functions besy0
?functions besy0
?besy0
 The `besy0` function returns the y0th Bessel function of its argument.
 `besy0` expects its argument to be in radians.
?expressions functions besy1
?functions besy1
?besy1
 The `besy1` function returns the y1st Bessel function of its argument.
 `besy1` expects its argument to be in radians.
?expressions functions ceil
?functions ceil
?ceil
 The `ceil` function returns the smallest integer that is not less than its
 argument. For complex numbers, `ceil` returns the smallest integer
 not less than the real part of its argument.
?expressions functions cos
?functions cos
?cos
 The `cos` function returns the cosine of its argument. `cos` expects its
 argument to be in radians.
?expressions functions cosh
?functions cosh
?cosh
 The `cosh` function returns the hyperbolic cosine of its argument.
 `cosh` expects its argument to be in radians.
?expressions functions exp
?functions exp
?exp
 The `exp` function returns the exponential function of its argument
 (`e` raised to the power of its argument).
?expressions functions floor
?functions floor
?floor
 The `floor` function returns the largest integer not greater than its
 argument. For complex numbers, `floor` returns the largest
 integer not greater than the real part of its argument.
?expressions functions gamma
?functions gamma
?gamma
 The `gamma` function returns the gamma function of the real part of
 its argument. For integer n, gamma(n+1) = n! .
 If the argument is a complex value, the imaginary component is ignored.
?expressions functions imag
?functions imag
?imag
 The `imag` function returns the imaginary part of its argument as a
 real number.
?expressions functions int
?functions int
?int
 The `int` function returns the integer part of its argument, truncated
 toward zero.
?expressions functions log
?functions log
?log
 The `log` function returns the natural logarithm (base `e`) of its
 argument.
?expressions functions log10
?functions log10
?log10
 The `log10` function returns the logarithm (base 10) of its argument.
?expressions functions real
?functions real
?real
 The `real` function returns the real part of its argument.
?expressions functions sgn
?functions sgn
?sgn
 The `sgn` function returns 1 if its argument is positive, -1 if its
 argument is negative, and 0 if its argument is 0. If the argument
 is a complex value, the imaginary component is ignored.
?expressions functions sin
?functions sin
?sin
 The `sin` function returns the sine of its argument. `sin` expects its
 argument to be in radians.
?expressions functions sinh
?functions sinh
?sinh
 The `sinh` function returns the hyperbolic sine of its argument. `sinh`
 expects its argument to be in radians.
?expressions functions sqrt
?functions sqrt
?sqrt
 The `sqrt` function returns the square root of its argument.
?expressions functions tan
?functions tan
?tan
 The `tan` function returns the tangent of its argument. `tan` expects
 its argument to be in radians.
?expressions functions tanh
?functions tanh
?tanh
 The `tanh` function returns the hyperbolic tangent of its argument.
 `tanh` expects its argument to be in radians.
?expressions operators
?operators
 The operators in GNUPLOT are the same as the corresponding operators
 in the C programming language, except that all operators accept
 integer, real, and complex arguments, unless otherwise noted.
 The ** operator (exponentiation) is supported, as in FORTRAN.
 
 Parentheses may be used to change order of evaluation.
?expressions operators binary
?operators binary
?binary
 The following is a list of all the binary operators and their
 usages:
 
  Symbol      Example      Explanation
   **          a**b          exponentiation
   *           a*b           multiplication
   /           a/b           division
   %           a%b         * modulo
   +           a+b           addition
   -           a-b           subtraction
   ==          a==b          equality
   !=          a!=b          inequality
   &           a&b         * bitwise AND
   ^           a^b         * bitwise exclusive OR
   |           a|b         * bitwise inclusive OR
   &&          a&&b        * logical AND
   ||          a||b        * logical OR
   ?:          a?b:c       * ternary operation
 
 (*) Starred explanations indicate that the operator requires
 integer arguments.
 
 Logical AND (&&) and OR (||) short-circuit the way they do in C.
 That is, the second && operand is not evaluated if the first is
 false; the second || operand is not evaluated if the first is true.
 
 The ternary operator evaluates its first argument (a). If it is
 true (non-zero) the second argument (b) is evaluated and returned,
 otherwise the third argument (c) is evaluated and returned.
?expressions operators unary
?operators unary
?unary
 The following is a list of all the unary operators and their
 usages:
 
  Symbol     Example      Explanation
   -           -a          unary minus
   ~           ~a        * one's complement
   !           !a        * logical negation
   !           a!        * factorial
 
 (*) Starred explanations indicate that the operator requires an
 integer argument.
 
 The factorial operator returns a real number to allow a greater range.
?help
 The `help` command displays on-line help. To specify information on a
 particular topic use the syntax:
 
         help {<topic>}
 
 If <topic> is not specified, a short message is printed about
 GNUPLOT. After help for the requested topic is given, help for a
 subtopic may be requested by typing its name, extending the help
 request. After that subtopic has been printed, the request may be
 extended again, or simply pressing return goes back one level to the
 previous topic. Eventually, the GNUPLOT command line will return.
?load
 The `load` command executes each line of the specified input file as
 if it had been typed in interactively. Files created by the `save`
 command can later be `load`ed. Any text file containing valid
 commands can be created and then executed by the `load` command.
 Files being `load`ed may themselves contain `load` commands. See
 `comment` for information about comments in commands.
 
 The `load` command must be the last command on the line.
 
 Syntax:
         load "<input-file>"
 
 The name of the input file must be enclosed in quotes.
 
 Examples:
 
         load 'work.gnu'
         load "func.dat"
 
 The `load` command is performed implicitly on any file names given as
 arguments to GNUPLOT. These are loaded in the order specified, and
 then GNUPLOT exits.
?pause
 The `pause` command displays any text associated with the command and
 then waits a specified amount of time or until the carriage return is
 pressed.  `pause` is especially useful in conjunction with `load` files.

 Syntax:
         pause <time> {"<string>"}

 <time> may be any integer constant or expression. Choosing -1 will
 wait until a carriage return is hit, zero (0) won't pause at all, and
 a positive integer will wait the specified number of seconds.
 
 Note: Since `pause` is not part of the plot it may interact with
 different device drivers differently (depending upon how text and
 graphics are mixed).
 
 Examples:
         pause -1    # Wait until a carriage return is hit
         pause 3     # Wait three seconds
         pause -1  "Hit return to continue"
         pause 10  "Isn't this pretty?  It's a cubic-spline."
 
?plot
?splot
 `plot` and `splot` are the primary commands of the program. They plot
 functions and data in many, many ways. `plot` is used to plot 2-d
 functions and data, while `splot` plots 3-d surfaces and data.

 Syntax:
 
         plot {ranges}  <function> {title} {style}
                     {, <function> {title} {style}...}
 
         splot {ranges}  <function> {title} {style}
                      {, <function> {title} {style}...}
 
 where <function> is either a mathematical expression, the name of a
 data file enclosed in quotes, or a pair (`plot`) or triple (`splot`)
 of mathematical expressions in the case of parametric functions.
 User-defined functions and variables may also be defined here.
 
 `plot` and `splot` commands can be as simple as
 
         plot sin(x)
 
 and
 
         splot x * y
 
 or as complex as (!)
 
         plot [t=1:10] [-pi:pi*2] tan(t),"data.1" with lines,t**2 with points
?plot datafile
?plot data-file
?splot datafile
?splot data-file
?datafile
?data-file
?data
 Discrete data contained in a file can displayed by specifying the
 name of the data file (enclosed in quotes) on the `plot` or `splot`
 command line. Data files should contain one data point per line.
 Lines beginning with # (or ! on VMS) will be treated as comments
 and ignored. For `plot`s, each data point represents an (x,y)
 pair. For `splot`s, each point is an (x,y,z) triple. For `plot`s with
 error bars (see `plot errorbars`), each data point is either
 (x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
 line of a data file must be separated by blank space. This blank
 space divides each line into columns.

 For `plot`s the x value may be omitted, and for `splot`s the x
 and y values may be omitted. In either case the omitted values are
 assigned the current coordinate number. Coordinate numbers start at 0
 and are incremented for each data point read.

 To specify other formats, see `plot datafile using`.
 
 In the `plot` command, blank lines in the data file cause a break in
 the plot. There will be no line drawn between the preceding and
 following points if the plot style is `lines` or `linespoints` (see
 `plot style`). This does not change the plot style, as would plotting
 the data as separate curves.
 
 This example compares the data in the file population.dat to a
 theoretical curve:
 
         pop(x) = 103*exp((1965-x)/10)
         plot [1960:1990] 'population.dat', pop(x)
 
 The file population.dat might contain:
 
         # Gnu population in Antarctica since 1965
         1965   103
         1970   55
         1975   34
         1980   24
         1985   10
 
 When a data file is plotted, `samples` and `iso_samples` are ignored.
 Curves plotted using the `plot` command are automatically extended to
 hold the entire curve. Similarly grid data plotted using the `splot`
 command is automatically extended, using the assumption that isolines
 are separated by blank lines (a line with only a CR/LF in it).
 
 Implicitly, there are two types of 3-d datafiles. If all the isolines
 are of the same length, the data is assumed to be a grid data, i.e.,
 the data has a grid topology. Cross isolines in the other parametric
 direction (the ith cross isoline passes thru the ith point of all the
 provided isolines) will also be drawn for grid data. (Note contouring
 is available for grid data only.) If all the isolines are not of the
 same length, no cross isolines will be drawn and contouring that data
 is impossible.
 
 For splot if 3-d datafile and using format (see `splot datafile using`)
 specify only z (height field), a non parametric mode must be specified.
 If, on the other hand, x, y, and z are all specified, a parametric
 mode should be selected (see `set parametric`) since data is defining a
 parametric surface.

 A simple example of plotting a 3-d data file is
 
         set parametric
         splot 'glass.dat'
 
 or
 
         set noparametric
         splot 'datafile.dat'
 
 where the file datafile.dat might contain:
 
         # The valley of the Gnu.
         10
         10
         10
 
         10
         5
         10
 
         10
         1
         10
 
         10
         0
         10
 
 Note datafile.dat defines a 4 by 3 grid ( 4 rows of 3 points each ).
 Rows are separated by blank lines.

 On some computer systems with a popen function (UNIX), the datafile
 can be piped through a shell command by starting the file name
 with a '<'.  For example:

         pop(x) = 103*exp(x/10)
         plot '< awk "{print $1-1965 $2}" population.dat', pop(x)

 would plot the same information as the first population example
 but with years since 1965 as the x axis.
 
 For more information about 3-d plotting, see `splot`.
?plot datafile using
?plot data-file using
?splot datafile using
?splot data-file using
?using
 The format of data within a file can be selected with the `using` 
 option. An explicit scanf string can be used, or simpler column
 choices can be made.
 
 Syntax:
 
         plot "datafile" { using { <ycol> |
                                   <xcol>:<ycol> |
                                   <xcol>:<ycol>:<ydelta> |
                                   <xcol>:<ycol>:<ylow>:<yhigh> }
                                 {"<scanf string>"} } ...

 and

         splot "datafile" { using { <xcol>:<ycol>:<zcol> | <zcol> }
                                  {"<scanf string>"} } ...
 
 <xcol>, <ycol>, and <zcol> explicitly select the columns to plot from
 a space or tab separated multicolumn data file. If only <ycol> is
 selected for `plot`, <xcol> defaults to 1. If only <zcol> is selected
 for `splot`, then only that column is read from the file. An <xcol> of
 0 forces <ycol> to be plotted versus its coordinate number. <xcol>,
 <ycol>, and <zcol> can be entered as constants or expressions.

 If errorbars (see also `plot errorbars`) are used for `plot`s,
 ydelta (for example, a +/- error) should be provided as the third
 column, or ylow and yhigh as third and fourth columns.  These columns
 must follow the x and y columns.

 Scanf strings override any <xcol>:<ycol>(:<zcol>) choices, except for
 ordering of input, e.g.,
         plot "datafile" using 2:1 "%f%*f%f"
 causes the first column to be y and the third column to be x.

 If the scanf string is omitted, the default is generated based on the
 <xcol>:<ycol>(:<zcol>) choices. If the `using` option is omitted, "%f%f"
 is used for `plot` ("%f%f%f%f" for `errorbar` `plot`s) and "%f%f%f" is
 used for `splot`.
 
 Examples:
 
         plot "MyData" using "%*f%f%*20[^\n]%f" with lines

 Data are read from the file "MyData" using the format
 "%*f%f%*20[^\n]%f". The meaning of this format is: "%*f" ignore the
 first number, "%f" then read in the second and assign to x,
 "%*20[^\n]" then ignore 20 non-newline characters, "%f" then read in
 the y value.

         n=3;
         plot "MyData", "MyData" using n 

 causes GNUPLOT to plot the second and third columns of MyData versus
 the first column. The command 'n=4; replot' would then plot the second
 and fourth columns of MyData versus the first column.
 
         splot "glass.dat" using 1

 causes GNUPLOT to plot the first coordinate of the points of glass.dat
 as the z coordinate while ignoring the other two coordinates.
 
 Note: GNUPLOT first reads a line of the data file into a buffer and 
 then does a 
         sscanf(input_buffer, scanf_string, &x, &y{, &z});
 where 'x', 'y', and 'z' are of type 'float'. Any scanf string that
 specifies two (three for `splot`, three or four for `errorbars`) float
 numbers may be used.
?plot errorbars
?errorbars
 Error bars are supported for 2-d data file plots by reading one or
 two additional columns specifying ydelta or ylow and yhigh
 respectively. No support exists for x error bars or any error bars
 for `splot`s.

 In the default situation, GNUPLOT expects to see three or four
 numbers on each line of the data file, either (x, y, ydelta) or 
 (x, y, ylow, yhigh). The x coordinate must be specified. The order
 of the numbers must be exactly as given above. Data files in this
 format can easily be plotted with error bars:

         plot "data.dat" with errorbars

 The error bar is a vertical line plotted from (x, ylow) to (x,
 yhigh). If ydelta is specified instead of ylow and yhigh, 
 ylow=y-ydelta and yhigh=y+ydelta are derived. If there
 are only two numbers on the line, yhigh and ylow are both set to
 y. To get lines plotted between the data points, `plot` the
 data file twice, once with errorbars and once with lines.

 If y autoscaling is on, the y range will be adjusted to fit the
 error bars.

 The `using` option may be used to specify how columns of the data file
 are to be assigned to x, y, ydelta, ylow, and yhigh. The x column must
 be provided and both the x and y columns must appear before the
 errorbar columns. If three column numbers are given, they are x, y,
 and ydelta. If four columns are given, they are x, y, ylow, and
 yhigh.

 Examples:
 
         plot "data.dat" using 1:2:3:4 with errorbars
         plot "data.dat" using 3:2:6 with errorbars
         plot "data.dat" using 3:4:8:7 with errorbars
 
 The first example reads, x, y, ylow, and yhigh, from columns 1, 2, 3,
 and 4. This is equivalent to the default.  The second example reads x
 from the third column, y from second and ydelta from the sixth column.
 The third example reads x from the third column, y from the fourth,
 ylow from the eighth, and yhigh from seventh columns.
 
 See also `plot using` and `plot style`.
?plot parametric
?splot parametric
?parametric
 When in parametric mode (`set parametric`) mathematical expressions must
 be given in pairs for `plot` and in triplets for `splot`:
         plot sin(t),t**2
 or
         splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
 
 Data files are plotted as before, except any preceding parametric
 function must be fully specified before a data file is given as a
 plot. In other words, the x parametric function (sin(t) above) and
 the y parametric function (t**2 above) must not be interrupted with
 any modifiers or data functions; doing so will generate a syntax error
 stating that the parametric function is not fully specified.
 
 Ranges take on a different meaning when in parametric mode. The first
 range on the `plot` command is the `trange`, the next is the `xrange`,
 and the last is the `yrange`. For `splot` the order is `urange`,
 `vrange`, `xrange`, `yrange`, and finally `zrange`. The following
 `plot` command shows setting the `trange` to [-pi:pi], the `xrange` to
 [-1.3:1.3] and the `yrange` to [-1:1] for the duration of the plot:
         plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
 
 Other modifiers, such as `with` and `title`, may be specified only
 after the parametric function has been completed:
         plot sin(t),t**2 title 'Parametric example' with linespoints
?splot ranges
?plot ranges
?ranges
 The optional range specifies the region of the plot that will be
 displayed.
 
 Ranges may be provided on the `plot` and `splot` command line and
 affect only that plot, or in the `set xrange`, `set yrange`, etc.,
 commands, to change the default ranges for future plots.
 
 Syntax:
         [{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }
 
 where <dummy-var> is the independent variable (the defaults are x and
 y, but this may be changed with `set dummy`) and the min and max
 terms can be constant expressions.
 
 Both the min and max terms are optional. The ':' is also optional
 if neither a min nor a max term is specified. This allows '[ ]' to
 be used as a null range specification.
 
 Specifying a range in the `plot` command line turns autoscaling for
 that axis off for that plot. Using one of the `set` range commands
 turns autoscaling off for that axis for future plots, unless changed
 later. (See `set autoscale`).
 
 Examples:
 
 This uses the current ranges:
         plot cos(x)
 
 This sets the x range only:
         plot [-10:30] sin(pi*x)/(pi*x)
 
 This is the same, but uses t as the dummy-variable:
         plot [t = -10 :30]  sin(pi*t)/(pi*t)
 
 This sets both the x and y ranges:
         plot [-pi:pi] [-3:3]  tan(x), 1/x
 
 This sets only the y range, and turns off autoscaling on both axes:
         plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
 
 This sets xmax and ymin only:
         plot [:200] [-pi:]  exp(sin(x))
 
 This sets the x, y, and z ranges:
         splot [0:3] [1:4] [-1:1] x*y
?plot style
?splot style
?style
?plot with
?with
 Plots may be displayed in one of six styles: `lines`, `points`,
 `linespoints`, `impulses`, `dots`, or `errorbars`. The `lines` style
 connects adjacent points with lines. The `points` style displays a
 small symbol at each point. The `linespoints` style does both
 `lines` and `points`. The `impulses` style displays a vertical line
 from the x axis (or from the grid base for `splot`) to each point. The
 `dots` style plots a tiny dot at each point; this is useful for
 scatter plots with many points.

 The `errorbars` style is only relevant to 2-d data file plotting. It
 is treated like `points` for `splot`s and function `plot`s. For data
 `plot`s, `errorbars` is like `points`, except that a vertical error 
 bar is also drawn: for each point (x,y), a line is drawn from
 (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
 bar. The ylow and yhigh values are read from the data file's columns,
 as specified with the `using` option to plot. See `plot errorbars` for
 more information.
 
 Default styles are chosen with the `set function style` and
 `set data style` commands.
 
 By default, each function and data file will use a different 
 line type and point type, up to the maximum number of available 
 types. All terminal drivers support at least six different point
 types, and re-use them, in order, if more than six are required.
 The LaTeX driver supplies an additional six point types (all variants
 of a circle), and thus will only repeat after twelve curves are
 plotted with points.
 
 If desired, the style and (optionally) the line type and point type
 used for a curve can be specified.

 Syntax:
 
         with <style> {<linetype> {<pointtype>}}
 
 where <style> is either `lines`, `points`, `linespoints`, `impulses`,
 `dots`, or `errorbars`. The <linetype> and <pointtype> are positive
 integer constants or expressions and specify the line type and point
 type to be used for the plot. Line type 1 is the first line type used
 by default, line type 2 is the second line type used by default, etc.
 
 Examples:
 
 This plots sin(x) with impulses:
         plot sin(x) with impulses
 
 This plots x*y with points, x**2 + y**2 default:
         splot x*y w points, x**2 + y**2
 
 This plots tan(x) with the default function style, "data.1" with lines:
         plot [ ] [-2:5] tan(x), "data.1" with l
 
 This plots "leastsq.dat" with impulses:
         plot 'leastsq.dat' w i
 
 This plots "exper.dat" with errorbars and lines connecting the points:
         plot 'exper.dat' w lines, 'exper.dat' w errorbars
 Here 'exper.dat' should have three or four data columns.
 
 This plots x**2 + y**2 and x**2 - y**2 with the same line type:
         splot x**2 + y**2 with line 1, x**2 - y**2 with line 1
 
 This plots sin(x) and cos(x) with linespoints, using the
 same line type but different point types:
         plot sin(x) with linesp 1 3, cos(x) with linesp 1 4
 
 This plots file "data" with points style 3:
         plot "data" with points 1 3 
 Note that the line style must be specified when specifying the point
 style, even when it is irrelevant. Here the line style is 1 and the
 point style is 3, and the line style is irrelevant.
 
 See `set style` to change the default styles.
?plot title
?splot title
 A title of each plot appears in the key. By default the title is
 the function or file name as it appears on the plot command line.
 The title can be changed by using the `title` option. This option 
 should precede any `with` option.
 
 Syntax:
         title "<title>"
 
 where <title> is the new title of the plot and must be enclosed in
 quotes. The quotes will not be shown in the key.
 
 Examples:
 
 This plots y=x with the title 'x':
         plot x
 
 This plots the "glass.dat" file with the title 'surface of revolution':
         splot "glass.dat" title 'surface of revolution'
 
 This plots x squared with title "x^2" and "data.1" with title
 'measured data':
         plot x**2 title "x^2", "data.1" t 'measured data'
?print
 The `print` command prints the value of <expression> to the screen.
 
 Syntax:
         print <expression>
 
 See `expressions`.
?pwd
 The `pwd` command prints the name of the working directory to the screen.
 
 Syntax:
         pwd
?quit
 The `exit` and `quit` commands and END-OF-FILE character will exit
 GNUPLOT. All these commands will clear the output device (as the
 `clear` command does) before exiting.
?replot
 The `replot` command without arguments repeats the last `plot` or `splot`
 command. This can be useful for viewing a plot with different `set`
 options, or when generating the same plot for several devices.
 
 Arguments specified after a `replot` command will be added onto the last
 `plot` (`splot`) command (with an implied ',' separator) before it is
 repeated. `replot` accepts the same arguments as the `plot` (`splot`)
 commands except that ranges cannot be specified. See `command-line
 editing` for ways to edit the last `plot` (`splot`) command.
?save
 The `save` command saves user-defined functions, variables, set
 options or all three plus the last `plot` (`splot`) command to the
 specified file.
 
 Syntax:
         save  {<option>} "<filename>"
 
 where <option> is `functions`, `variables` or `set`. If no option is
 used, GNUPLOT saves functions, variables, set options and the last `plot`
 (`splot`) command.
 
 `save`d files are written in text format and may be read by the `load`
 command.
 
 The filename must be enclosed in quotes.
 
 Examples:
 
         save "work.gnu"
         save functions 'func.dat'
         save var 'var.dat'
         save set "options.dat"
?set
?show
 The `set` command sets LOTS of options.
 
 The `show` command shows their settings. `show all` shows all the
 settings.
?set angles
?show angles
?angles
 By default, GNUPLOT assumes the independent variable in polar plots
 is in units of radians. If `set angles degrees` is specified before
 `set polar` then the default range is [0:360] and the independent
 variable has units of degrees. This is particularly useful for
 plots of data files. The angle setting also hold for the 3-d
 mapping as set via the `set mapping` command.

 Syntax:
         set angles { degrees | radians }
         show angles
?set arrow
?set noarrow
?show arrow
?arrow
?noarrow
 Arbitrary arrows can be placed on a plot using the `set arrow`
 command.
 
 Syntax:
 
          set arrow {<tag>} {from <sx>,<sy>{,<sz>}} 
                            {to <ex>,<ey>{,<ez>}} {{no}head}
          set noarrow {<tag>}
          show arrow
 
 
 Unspecified coordinates default to 0. The x, y, and z values are in
 the graph's coordinate system. The z coordinate is only used in
 `splot` commands. <tag> is an integer that identifies the arrow. If no
 tag is given, the lowest unused tag value is assigned automatically.
 The tag can be used to delete or change a specific arrow. To change
 any attribute of an existing arrow, use the `set arrow` command with
 the appropriate tag, and specify the parts of the arrow to be
 changed. Specifying nohead requests the arrow be drawn without a head
 (yielding a line segment). By default, arrows have heads.
 
 Arrows outside the plotted boundaries are permitted but may cause
 device errors.
 
 Examples:
 
 To set an arrow pointing from the origin to (1,2), use:
          set arrow to 1,2
 To set an arrow from (-10,4,2) to (-5,5,3), and tag the arrow number
 3, use:
          set arrow 3 from -10,4,2 to -5,5,3
 To change the preceding arrow begin at 1,1,1, without an arrow head,
 use:
          set arrow 3 from 1,1,1 nohead
 To delete arrow number 2 use:
          set noarrow 2
 To delete all arrows use:
          set noarrow
 To show all arrows (in tag order) use:
          show arrow
?set autoscale
?set noautoscale
?show autoscale
?autoscale
?noautoscale
 Auto scaling may be set individually on the x, y or z axis
 or globally on all axes. The default is to autoscale all axes.
 
 When autoscaling, the plot range is automatically computed and the
 dependent axis (y for a `plot` and z for `splot`) is scaled to
 include the range of the function or data being plotted.
 
 If autoscaling of the dependent axis (y or z) is not set, the
 current y or z range is used.
 
 See `set yrange` or `set zrange`.
 
 Autoscaling the independent variables (x for `plot` and x,y for
 `splot`) is a request to set the domain to match any data file being
 plotted. If there are no data files then autoscaling an independent
 variable has no effect. In other words, in the absence of a data
 file, functions alone do not affect the x range (or the y range if
 plotting z = f(x,y)).
 
 See `set xrange`, or `set yrange`.
 
 The behavior of autoscaling remains consistent in parametric mode,
 however, there are more dependent variables and hence more control
 over x, y, and z plot scales. In parametric mode, the independent or
 dummy variable is t for `plot`s and u,v for `splot`s.  Autoscale in
 parametric mode, then, controls all ranges (t, u, v, x, y, and z) and
 allows x, y, and z to be fully autoscaled.
 
 See `set parametric`.
 
 Syntax:
         set autoscale <axes>
         set noautoscale <axes>
         show autoscale
 
 where <axes> is either `x`, `y`, `z` or `xy`. If <axes> is not given
 then all axes are assumed.
 
 Examples:
 
 This sets autoscaling of the y axis. x axis autoscaling is not
 affected.
         set autoscale y
 
 This sets autoscaling of the x and y axes.
         set autoscale xy
 
 This sets autoscaling of the x, y and z axes.
         set autoscale
 
 This disables autoscaling of the x, y and z axes.
         set noautoscale
 
 This disables autoscaling of the z axis only.
         set noautoscale z
?autoscale parametric
?set autoscale t
 When in parametric mode (`set parametric`) the xrange is as
 fully scalable as the yrange. In other words, in parametric
 mode the x axis can be automatically scaled to fit the range
 of the parametric function that is being plotted. Of course,
 the y axis can also be automatically scaled just as in the
 non-parametric case. If autoscaling on the x axis is not set,
 the current x range is used.
 
 When there is a mix of data files and functions, the xrange of
 the functions is selected as that of the data files if autoscale
 is true for x. While this keeps the behavior compatible with
 non-parametric plotting, it may not be retained in the future.
 The problem is that, in parametric mode, the x and y ranges are
 not as distinguishable as in the non-parametric mode and this
 behavior may not be the most useful.
 
 For completeness a last command `set autoscale t` is accepted.
 However, the effect of this "scaling" is very minor. When
 GNUPLOT determines that the t range would be empty it makes a
 small adjustment if autoscaling is true. Otherwise, GNUPLOT
 gives an error. Such behavior may, in fact, not be very useful
 and the command `set autoscale t` is certainly questionable.
 
 `splot` extends the above idea similarly. If autoscaling is set then
 x, y, and z ranges are computed and each axis scaled to fit the
 resulting data.
?set border
?set noborder
?show border
?border
?noborder
 The `set border` and `set noborder` commands controls the display of
 the plot borders for the `plot` and `splot` commands.
 
 Syntax:
         set border
         set noborder
         show border
?set clip
?set noclip
?show clip
?clip
?noclip
 GNUPLOT can clip data points and lines that are near the boundaries
 of a plot. 
 
 Syntax:
         set clip <clip-type>
         set noclip <clip-type>
         show clip

 Three clip types are supported by GNUPLOT: `points`, `one`, and `two`.
 One, two, or all three clip types may be active for a single plot.

 The `points` clip type forces GNUPLOT to clip (actually, not plot at
 all) data points that fall within but too close to the boundaries
 (this is so the large symbols used for points will not extend outside
 the boundary lines). Without clipping points near the boundaries may
 look bad; try adjusting the x and y ranges.

 Setting the `one` clip type causes GNUPLOT to plot the line segments
 which have only one of the two endpoints with the plotting region.
 Only the in-range portion of the line is drawn.  The alternative is to
 not draw any portion of the line segment.

 Some lines may have both endpoints out of range, but pass through the
 plotting area. Setting the `two` clip-type allows the visible portion
 of these lines to be drawn.
 
 In no case is a line drawn outside the plotting area.

 The defaults are `noclip points`, `clip one`, and `noclip two`.

 To check the state of all forms of clipping, use
         show clip

 For backward compatibility with older versions, the following forms
 are also permitted.
        set clip
        set noclip
 `set clip` is synonymous with `set clip points`. `set noclip` turns
 off all three types of clipping.
?set cntrparam
?show cntrparam
?cntrparam
 Sets the different parameters for the contouring plot (see also `contour`).
 
 Syntax:
         set cntrparam { { linear | cubicspline | bspline } |
                         points <n> |
                         levels <n> |
                         order <n> }
 
 This command controls the way contours are plotted. <n> should be an
 integral constant expression. The parameters are:
 
 `linear`, `cubicspline`, `bspline` - Controls type of approximation or
 interpolation. If `linear`, then the contours are drawn piecewise
 linear, as extracted from the surface directly. If `cubicspline`, then
 piecewise linear contours are interpolated to form a somewhat smoother
 contours, but which may undulate. The third option is the uniform
 `bspline`, which only approximates the piecewise linear data but is
 guaranteed to be smoother.
 
 `points` - Eventually all drawings are done with piecewise linear
 strokes.  This number controls the number of points used to
 approximate a curve.  Relevant for `cubicspline` and `bspline` modes
 only.
 
 `levels` - Number of contour levels. If the surface is bounded by zmin
 and zmax then contours will be generated from zmin+dz to zmax-dz
 in steps of size dz, where dz = (zmax - zmin) / (levels + 1).
 
 `order`  - Order of the bspline approximation to be used. The bigger this
 order is, the smoother the resulting contour.  (Of course, higher order
 bspline curves will move further away from the original peicewise linear
 data.)  This option is relevant for `bspline` mode only. Allowed values are 
 integers in the range from 2 (linear) to 10.
?set contour
?show contour
?contour
 Enable contour drawing for surfaces. This option is available for `splot`
 only.
 
 Syntax:
         set contour { base | surface | both }
         set nocontour
 
 If no option is provided to `set contour`, the default is `base`.
 The three options specify where to draw the contours: `base` draws
 the contours on the grid base where the x/ytics are placed, `surface`
 draws the contours on the surfaces themselves, and `both` draws the
 contours on both the base and the surface.
 
 See also `set cntrparam` for the parameters that affect the drawing of 
 contours.
?set data style
?show data style
?data style
 The `set data style` command changes the default plotting style
 for data plots.

 Syntax:
         set data style 
         show data style 
         set data style <style-choice>

 In the first case, `set data style` returns the possible style
 choices:  `lines`, `points`, `linespoints`, `dots`, `impulses`, 
 or `errorbars`.  `show data style` shows the current default
 plotting style for data.  `set data style dots` would actually 
 change the default plotting style.  See also `plot`.
?set dummy
?show dummy
?dummy
 By default, GNUPLOT assumes that the independent variable for the
 `plot` command is x, and the independent variables for the `splot`
 command are x and y. They are called the dummy variables because it
 is just a notation to indicate the independent variables. The `set
 dummy` command changes these default dummy variable names. For
 example, it may be more convenient to call the dummy variable t
 when plotting time functions:
 
         set dummy t
         plot sin(t), cos(t)
 
 Syntax:
         set dummy <dummy-var>{,<dummy-var>}
         show dummy
 
 Examples:
         set dummy u,v
         set dummy ,s
 
 to set both dummy variables to u and v or set only the second
 variable to s.
 
 The `set parametric` command also changes the dummy variables (to t
 for `plot` and u,v for `splot`s).
 
?set format
?show format
?format
 The format of the tic-mark labels can be set with the `set format`
 command. The default format for both axes is "%g", but other formats
 such as "%.2f" or "%3.0fm" are often desirable. Anything accepted by
 printf when given a double precision number, and then accepted by the
 terminal, will work. In particular, the formats f, e, and g will work,
 and the d, o, x, c, s, and u formats will not work.
 
 Syntax:
         set format {<axes>} {"<format-string>"}
         show format
 
 where <axes> is either `x`, `y`, `z`, `xy`, or nothing (which is the
 same as `xy`). The length of the string representing a ticmark (after
 formatting with printf) is restricted to 100 characters.  If the
 format string is omitted, the format will be returned to the default
 "%g". For LaTeX users, the format "$%g$" is often desirable.  If the
 empty string "" is used, no label will be plotted with each tic,
 though the tic mark will still be plotted. To eliminate all tic marks,
 use `set noxtics` or `set noytics`.
 
 See also `set xtics` and `set ytics` for more control over tic labels.
?set function style
?show function style
?function style
 The `set function style` command changes the default plotting style
 for functions.

 Syntax:
         set function style 
         show function style 
         set function style <style-choice>

 In the first case, `set function style` returns the possible style
 choices:  `lines`, `points`, `linespoints`, `dots`, `impulses`, 
 or `errorbars`.  `show function style` shows the current default
 plotting style for functions.  `set function style linespoints`
 would actually change the default plotting style.  See also `plot`.
?show functions
 The `show functions` command lists all user-defined functions and
 their definitions.
 
 Syntax:
         show functions
?set grid
?show grid
?grid
 The optional `set grid` draws a grid at the tic marks with the axis
 linetype.
 
 Syntax:
         set grid
         set nogrid
         show grid
?set hidden3d
?show hidden3d
 The `set hidden3d` command enables hidden line removal for explicit
 surface plotting (see `splot`).
 Hidden line removal may be used for both explicit functions
 and for explicit data where gnuplot plot is in nonparametric mode (see
 `set parametric`).
 
 When this flag is set both the surface hidden portion and possibly
 its hidden contours (see `set contour`) as well as the hidden grid will be
 removed. Labels and arrows are always visible and are unaffected by this
 command.
 
 Each surface has its hidden part removed with respect to itself, if more
 than one surface is ploted. This mode is meaningfull when surfaces are
 plotted using line style drawing only.

 Syntax:
         set hidden3d
         set nohidden3d
         show hidden3d
?set isosamples
?show isosamples
?isosamples
 An isoline is a curve parametrized by one of the surface parameters
 while the other surface parameter is fixed. Isolines are a simple
 means to display a surface. By fixing the u parameter of surface
 s(u,v), the iso-u lines of the form c(v) = s(u0,v) are produced, and
 by fixing the v parameter, the iso-v lines of the form c(u) = s(u,v0)
 are produced.
 
 The isoline density of surfaces may be changed by the `set isosamples`
 command. By default, sampling is set to 10 isolines per u or v axis.
 A higher sampling rate will produce more accurate plots, but will take
 longer. This parameter has no effect on data file plotting.
 
 Syntax:
         set isosamples <expression>
         show isosamples
?set key
?show key
?key
 The `set key` enables a key describing curves on a plot.  By default
 the key is placed in the upper right corner of the plot.
 
 Syntax:
         set key
         set key <x>,<y>{,<z>}
         set nokey
         show key
 
 The coordinates <x>, <y> (and <z> for `splot`s) specify the location
 of the key on the plot. The key is drawn as a sequence of lines, with
 one plot described on each line. On the right hand side of each line
 is a representation that attempts to mimic the way the curve is
 plotted.  On the left side of each line is the text description,
 obtained from the `plot` command. See `plot title` to change this
 description. The lines are vertically arranged so an imaginary
 straight line divides the left- and right-hand sides of the key. It is
 the coordinates of this line that are specified with the `set key`
 command. In a `plot`, only the x and y coordinates are used to specify
 the line position.  For a `splot`, x, y and z are all being used as a
 3-d location mapped using the same mapping as the plot itself to form
 the required 2-d screen position of the imaginary line.
 
 Some or all of the key may be outside of the plot boundary, although
 this may interfere with other labels and may cause an error on some
 devices.
 
 Examples:
 
 This places the key at the default location:
         set key
 This disables the key:
         set nokey
 This places a key at coordinates 2,3.5,2
         set key 2,3.5,2
?set label
?set nolabel
?show label
?label
?nolabel
 Arbitrary labels can be placed on the plot using the `set label`
 command.  If the z coordinate is given on a `plot` it is ignored; if
 it is missing on a `splot` it is assumed to be 0.
 
 Syntax:
 
          set label {<tag>} {"<label_text>"} {at <x>,<y>{,<z>}}
                            {<justification>}
          set nolabel {<tag>}
          show label
 
 
 The text defaults to "", and the position to 0,0,0.  The <x>, <y>, and
 <z> values are in the graph's coordinate system.  The tag is an
 integer that is used to identify the label. If no <tag> is given, the
 lowest unused tag value is assigned automatically. The tag can be used
 to delete or change a specific label. To change any attribute of an
 existing label, use the `set label` command with the appropriate tag,
 and specify the parts of the label to be changed.
 
 By default, the text is placed flush left against the point x,y,z.
 To adjust the way the label is positioned with respect to the point
 x,y,z, add the parameter <justification>, which may be `left`, `right`
 or `center`, indicating that the point is to be at the left, right or
 center of the text. Labels outside the plotted boundaries are
 permitted but may interfere with axes labels or other text.
 
 Examples:
 
 To set a label at (1,2) to "y=x" use:
          set label "y=x" at 1,2
 To set a label "y=x^2" with the right of the text at (2,3,4), and tag
 the label number 3, use:
          set label 3 "y=x^2" at 2,3,4 right
 To change the preceding label to center justification, use:
          set label 3 center
 To delete label number 2 use:
          set nolabel 2
 To delete all labels use:
          set nolabel
 To show all labels (in tag order) use:
          show label
 
 (The Latex, EEPIC, and Imagen drivers allow \\ in a string to specify
 a newline.)
?set logscale
?set nologscale
?show logscale
?logscale
?nologscale
 Log scaling may be set on the x, y, and z axes.
 
 Syntax:
         set logscale <axes>
         set nologscale <axes>
         show logscale
 
 where <axes> may be any combinations of `x`, `y`, and `z`, in any
 order.  If <axes> is not given then all three axes are assumed.  The
 command `set logscale` turns on log scaling on the specified axes,
 while `set nologscale` turns off log scaling.
 
 Examples:
 
 To enable log scaling in both x and z axes:
        set logscale xz
 To disable z axis log scaling:
        set nologscale z
?set mapping
?show mapping
?mapping
 
 Syntax:
         set mapping { cartesian | spherical | cylindrical }
 
 Data for `splot`s are usually in regular Euclidean space and are
 provided in Cartesian coordinates. Such 3-d data require three
 coordinates (x, y and z) or one coordinate (only z) in each line in
 the data file.  In order to be able to use spherical or cylindrical
 coordinate systems, use the `set mapping` command. In both cases two
 coordinates are expected in each line of the data. For a spherical
 coordinate system, these are theta and phi (in units as specified by
 `set angles`) and the mapping is:
 
         x = cos( theta ) * cos( phi )
         y = sin( theta ) * cos( phi )
         z = sin( phi )
 
 For a cylindrical coordinate system, the mapping uses two variables,
 theta (in units as specified by `set angles`) and z:
 
         x = cos( theta )
         y = sin( theta )
         z = z
 
 Again, note that mapping will affect data file `splot`s only.
?set offsets
?show offsets
?offsets
 The amount of the graph that the plot takes up may be controlled to
 some extent with the `set offsets` command. This command takes four
 offset arguments: <left>, <right>, <top> and <bottom>. By default,
 each offset is 0. Each offset may be a constant or an expression. Left
 and right offsets are given in units of the x axis, while top and
 bottom offsets are given in units of the y axis. The plot of sin(x),
 displayed with offsets of 0, 0, 2, 2 will take up 1/3 of the
 displayed y axis. Offsets are particularly useful with polar
 coordinates as a means of compensating for aspect ratio distortion.
 Offsets are ignored in `splot`s.
 
 Syntax:
         set offsets <left>, <right>, <top>, <bottom>
         show offsets
?set output
?show output
?output
 By default, plots are displayed to the standard output. The `set
 output` command redirects the display to the specified file or
 device.
 
 Syntax:
         set output {"<filename>"}
         show output
 
 The filename must be enclosed in quotes. If the filename is
 omitted, output will be sent to the standard output.

 On machines with popen functions (UNIX), output can be piped
 through a shell command if the first letter of the filename
 is '|'.  For instance,
 
 Syntax:
         set output "|lpr -Plaser filename"
         set output "|lp -dlaser filename"

 (On MSDOS machines, set output "prn" will direct the output
 to the default printer.)

?set parametric
?set noparametric
?show parametric
?parametric
?noparametric
 The `set parametric` command changes the meaning of `plot` (`splot`)
 from normal functions to parametric functions. The command
 `set noparametric` changes the plotting style back to normal,
 single-valued expression plotting.
 
 In 2-d plotting, a parametric function is determined by a pair
 of parametric functions operating on a parameter. An example
 of a 2-d parametric function would be plot sin(t),cos(t) (which
 defines a circle).
 
 For 3-d plotting, the surface is described as x=f(u,v), y=g(u,v),
 z=h(u,v). Therefore a triplet of functions are required. An example of
 3-d parametric function would be cos(u)*cos(v),cos(u)*sin(v),sin(u)
 (which defines a sphere). It takes three parametric function
 specifications in terms of the parametric dummy arguments to describe
 a single graph.
 
 The total set of possible plots is a superset of the simple f(x)
 style plots, since the two (three) functions can describe the
 x and y (and z) values to be computed separately. In fact,
 plots of the type t,f(t) (u,v,f(u,v)) are equivalent to those
 produced with f(x) when the x values are computed using the
 identity function as the first function.
 
 Note that the order the parametric functions are specified is
 xfunction, yfunction (and zfunction) and that each operates over the
 common parametric domain.
 
 Also, the `set parametric` function implies a new range of values.
 Whereas the normal f(x) and f(x,y) style plotting assume an xrange
 and yrange (and zrange), the parametric mode additionally specifies a
 trange, urange, and vrange. These ranges may be set
 directly with `set trange`, `set urange` and `set vrange`, or by
 specifying the range on the `plot` or `splot` commands. Currently
 the default range for these parametric variables is [-5:5].
 Setting the ranges to something more meaningful is expected.
?set polar
?set nopolar
?show polar
?polar
?nopolar
 The `set polar` command changes the meaning of the plot from
 rectangular coordinates to polar coordinates. In polar coordinates,
 the dummy variable (x) is an angle. The range of this angle is changed
 from whatever it was to [0:2*pi], or, if degree unit has been selected,
 to [0:360] (see `set angles`).
 
 The command `set nopolar` changes the meaning of the plot back to the
 default rectangular coordinate system. The range of x is changed from
 whatever it was to [-10:10].
 
 The `set polar` command is not supported for `splot`s.  See the
 `set mapping` command for similar functionality for `splot`s.
 
 While in polar coordinates the meaning of an expression in x is really
 r = f(x), where x is an angle of rotation. The xrange controls the
 domain (the angle) of the function, and the yrange controls the range
 (the radius). The plot is plotted in a rectangular box, and the x and
 y axes are both in units of the radius. Thus, the yrange controls both
 dimensions of the plot output. The tics and units are written along
 the axes rather than at the left and bottom. These unit are offset by
 <rmin> specified by the `rrange` (See `set rrange`). It is not
 possible to specify different output dimensions in the x or y
 directions. The yrange can be used to shift the plot diagonally to
 display only the first or third quadrants.
 
 Syntax:
         set polar
         set nopolar
         show polar
 Example:
         set polar
         plot x*sin(x)
         plot [-2*pi:2*pi] [-3:3] x*sin(x)
 The first plot uses the default polar angular domain of 0 to 2*pi.
 The radius (and the size of the plot) is scaled automatically. The
 second plot expands the domain, and restricts the range of the radius
 (and the size of the plot) to [-3:3].
?set rrange
?show rrange
?rrange
 The `set rrange` command sets the radial range used to compute x and y
 values when in polar mode. If not in polar mode (see `set polar`) then
 this range is not used. Use of this command offsets the polar
 singularity to the <rmin> value and shifts the units on the axes tic
 marks. For instance, `set rrange [-40:40]` would set the origin to -40
 and would plot values of radial values between -40 to 40. Thus, if
 360 degrees of data were plotted, then the plot would extend 80 units
 in radially from the origin.  To view the entire plot,  a 
 `set yrange [-80:80]` command would create a square viewport with
 a circular plot tangent at the axes.  Because `xrange` is used
 specify the angular extent, only a square viewport can be specified
 by `yrange`.  For instance, `set yrange [0:80]` would display the
 first quadrant and `set yrange [-80:0]` would display the third
 quadrant.  Any square viewport of any size can be specified but it
 is constrained to be centered on a 45 degree line.
 
 This range may also be specified on the `plot` command line when in
 polar mode.
 
 Syntax:
         set rrange [{<rmin> : <rmax>}]
 
 where <rmin> and <rmax> terms are constants or expressions.
 
 Both the <rmin> and <rmax> terms are optional. Anything omitted will
 not be changed, so 
         set rrange [:10]
 changes rmax to 10 without affecting rmin.
?set samples
?show samples
?samples
 The sampling rate of functions may be changed by the `set samples`
 command. By default, sampling is set to 100 points. A higher sampling
 rate will produce more accurate plots, but will take longer. This
 parameter no longer has any effect on data-file plotting.
 
 Syntax:
         set samples <expression>
         show samples
?set size
?show size
?size
 The `set size` command scales the displayed size of the plot.  On some
 terminals, changing the size of the plot will result in text being
 misplaced. Increasing the size of the plot may produce strange
 results. Decreasing is safer.
 
 Syntax:
 
         set size {<xscale>,<yscale>}
         show size
 
 The <xscale> and <yscale> values are the scaling factors for the size.
 The defaults (1,1) are selected if the scaling factors are omitted.
 
 Examples: 
 
 To set the size to normal size use:
         set size
 To make the plot half size use:
         set size 0.5,0.5
 To make a landscape plot have a 1:1 aspect ratio in polar mode use:
         set size 0.721,1.0
 To show the size use:
         show size
 
 For the LaTeX and Fig terminals the default size (scale factor 1,1)
 is 5 inches wide by 3 inches high. The big Fig terminal (`bfig`) is 7
 inches wide by 5 inches high. The postscript default is landscape mode
 10 inches wide and 7 inches high. 
 Note that the size of the plot includes the space used by the labels; 
 the plotting area itself is smaller. 
?set style
?show style
?style
 Plots may be displayed in one of six styles: `lines`, `points`,
 `linespoints`, `impulses`, `dots`, or `errorbars`. The `lines` style
 connects adjacent points with lines. The `points` style displays a
 small symbol at each point. The `linespoints` style does both
 `lines` and `points`. The `impulses` style displays a vertical line
 from the x axis to each point. The `dots` style plots a tiny dot at
 each data point; this is useful for scatter plots with many points.
 
 The `errorbars` style is relevant only for to data file `plot`s. It is
 treated like `points` for function `plot`s and `splot`s. For data file
 `plot`s, `errorbars` is like `points`, except that a vertical error
 bar is also drawn: for each point (x,y), a line is drawn from (x,ylow)
 to (x,yhigh). A tic mark is placed at the ends of the error bar. The
 ylow and yhigh values are read from the data file's third and fourth
 columns, or as specified with the `using` option to plot.  See `plot
 errorbars` for more information.
 
 Default styles are chosen with the `set function style` and `set
 data style` commands. See `plot style` for information about how
 to override the default plotting style for individual functions.
 
 Syntax:
         set function style <style>
         set data style <style>
         show function style
         show data style
 
 where <style> is `lines`, `points`, `linespoints`, `impulses`,
 `dots`, or `errorbars`.
?set surface
?set nosurface
?show surface
?surface
 `set surface` controls the display of surfaces. It is useful if
 contours are to be displayed by themselves. Whenever `set nosurface`
 is issued, no surface isolines/mesh will be drawn. See also `set
 contour`.
 
 Syntax:
         set surface
         set nosurface
         show surface
?set terminal
?show terminal
?terminal
 GNUPLOT supports many different graphics devices. Use the `set
 terminal` command to select the type of device for which GNUPLOT
 will produce output.
 
 Syntax:
         set terminal {<terminal-type>}
         show terminal
 
 If <terminal-type> is omitted, GNUPLOT will list the available
 terminal types. <terminal-type> may be abbreviated.
 
 Use `set output` to redirect this output to a file or device.

 Several terminals have additional options. For example, see `dumb`,
 `iris4d`, `hpljii` or `postscript`.
?set terminal dumb
?dumb
 The dumb terminal driver has an optional size specification.

 Syntax:
         set terminal dumb {<xsize> <ysize>}

 where <xsize> and <ysize> set the size of the dumb terminals. Default
 is 79 by 24.

 Examples:
         set term dumb
         set term dumb 79 49 #(VGA screen - why would anyone want to do that!?)
 
?set terminal hpljii
?hpljii
 The HP LaserJet II and HP DeskJet drivers have a single option.

 Syntax:
         set terminal hpljii {<resolution>}
         set terminal hpdj   {<resolution>}

 where <resolution> is the resolution of the output in dots per inch.
 It must be `75`, `100`, `150` or `300`.

 Example:
         set terminal hpljii 150
 
?set terminal iris4d
?iris4d
 The iris4d driver can operate in two modes.

 Syntax:
         set terminal iris4d {24}

 If the hardware supports only 8 bits, use the default `set terminal
 iris4d`. If, however, the hardware supports 24 bits (8 per
 red/green/blue), use `set terminal iris4d 24`.

 When using 24-bit mode, the colors can be directly specified via the
 file .gnuplot_iris4d that is searched in the current directory and
 then in the home directory specified by the HOME environment variable.
 This file holds RGB values for the background, border, labels and nine
 plotting colors, in that order. For example, here is a file containing
 the default colors:
 
         85   85   85     /* Back Ground */
         0    0    0      /* Boundary */
         170  0    170    /* Labeling */
         85   255  255    /* Plot Color 1 */
         170  0    0      /* Plot Color 2 */
         0    170  0      /* Plot Color 3 */
         255  85   255    /* Plot Color 4 */
         255  255  85     /* Plot Color 5 */
         255  85   85     /* Plot Color 6 */
         85   255  85     /* Plot Color 7 */
         0    170  170    /* Plot Color 8 */
         170  170  0      /* Plot Color 9 */
 
 This file has exactly 12 lines of RGB triples. No empty lines are
 allowed and anything after the third number in line is ignored.
 
?set terminal pbm
?pbm
 Several options may be set in the PBMplus driver.

 Syntax:
         set terminal pbm {<fontsize>}
         set terminal pgm {<fontsize>}
         set terminal ppm {<fontsize>}

 where <fontsize> is `small`, `medium`, or `large`. 
 Default size is 640 pixels wide and 480 pixels high.
 The pbm output is a portable bitmap (one bit per pixel).
 The pgm output is a portable graymap (three bits per pixel). 	
 The ppm output is a portable pixmap (color, four bits per pixel).
 The output of these drivers can be used with Jef Poskanzer's 
 excellent PBMPLUS package which provides programs to convert
 the above PBMPLUS formats to GIF, TIFF, MacPaint, Macintosh PICT,
 PCX, X11 bitmap and many others. 

 Examples:
 
         set term pbm small
         set size 2,2
         set term ppm medium
 
?set terminal postscript
?postscript
 Several options may be set in the PostScript driver.

 Syntax:
         set terminal postscript {<mode>} {<color>}
                                 {"<fontname>"} {<fontsize>}

 where <mode> is `landscape`, `portrait`, `eps` or `default`. 
 Selecting default sets all options to their defaults.
 <color> is either `color` or `monochrome`.
 "<fontname>" is the name of a valid PostScript font.
 <fontsize> is the size of the font in PostScript points, before 
 scaling by the `set size` command.
 Defaults are `landscape`, `monochrome`, "Courier", and 14pt.
 Default size of PostScript plot is landscape mode 10 inches wide 
 and 7 inches high.

 To get EPS output, use the `eps` mode and make only one plot per file.
 In `eps` mode the whole plot is halved in size; the fonts are half the 
 given size, and the plot is 5 inches wide and 3.5 inches high.

 Examples:
 
         set term postscript default       # old postscript
         set term postscript landscape 22  # old psbig
         set term postscript eps 14   # old epsf1
         set term postscript eps 22   # old epsf2
         set size 0.7,1.4
         set term post portrait color "Times-Roman" 14 
 
?set terminal aifm
?aifm
 Several options may be set in the Adobe Illustrator 3.0 driver.

 Syntax:
         set terminal aifm {<color>}
                                 {"<fontname>"} {<fontsize>}

 Selecting default sets all options to their defaults.
 <color> is either `color` or `monochrome`.
 "<fontname>" is the name of a valid PostScript font.
 <fontsize> is the size of the font in PostScript points, before 
 scaling by the `set size` command.
 Defaults are `monochrome`, "Courier", and 14pt.

 Also, since AI does not really support multiple pages, multiple 
 graphs will be output directly on one another.  However, each graph 
 will be grouped individually, making it easy to separate them inside 
 AI (just pick them up and move them).

 Examples:
 
         set term aifm 
         set term aifm 22  
         set size 0.7,1.4
         set ter