home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-22 | 81.4 KB | 3,378 lines |
- Newsgroups: comp.sources.misc
- From: woo@playfair.stanford.edu ("Alexander Woo")
- Subject: v40i032: gnuplot - interactive function plotting utility, Part20/33
- Message-ID: <1993Oct22.163738.24429@sparky.sterling.com>
- X-Md4-Signature: 484a588c025240c6096a8b9e4c55e830
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Fri, 22 Oct 1993 16:37:38 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
- Posting-number: Volume 40, Issue 32
- Archive-name: gnuplot/part20
- Environment: UNIX, MS-DOS, VMS
- Supersedes: gnuplot3: Volume 24, Issue 23-48
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: gnuplot/History gnuplot/demo/world.dat
- # gnuplot/docs/latextut/tutorial.tex gnuplot/plot.h
- # gnuplot/term/hp26.trm
- # Wrapped by kent@sparky on Wed Oct 20 17:14:53 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 20 (of 33)."'
- if test -f 'gnuplot/History' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/History'\"
- else
- echo shar: Extracting \"'gnuplot/History'\" \(10765 characters\)
- sed "s/^X//" >'gnuplot/History' <<'END_OF_FILE'
- X
- X GNUPLOT 3.0 RELEASE NOTES
- X
- XThis describes changes to gnuplot since version 2.02 (ie, 2.0
- Xpatchlevel 2).
- X
- XHighlights:
- X-----------
- XGnuplot now handles surfaces as well. A new command names 'splot' (for
- Xsurface plot) has been added for that purpose. A number of new 'set'
- Xoptions for surfaces have also been added and include: isosamples,
- Xview, contour, cntrparam, mapping and surface. All tic/label/range
- Xsetting for x and y axes were extended for z as well.
- X
- XThe size of data file for both curves and surfaces is now independent
- Xof the samples (and iso_samples) variables. Data structures will
- Xautomatically be extended to hold the entire data file.
- X
- XNew features:
- X-------------
- X3-d plotting with 'splot', and many auxiliary options.
- X
- XNew 'errorbars' plot style.
- X
- XNew 'using x:y{:z}' format (NOT COMPATIBLE WITH GNUPLOT 2.02).
- X
- XData file plotting (for both curves and surfaces) does not require
- Xsetting samples (and isosamples for surfaces) any more. Size is
- Xincreased on the fly, without affecting the sample rate of functions.
- X
- XNew makefile scheme for unix, that supports lots of flavors.
- X
- XCommand-line editing and history.
- X
- XAdjustable display of plot border ('set border').
- X
- XSet-commands 'x/y/zlabel' can now position the label.
- X
- XSet-command 'title' can now position the title.
- X
- XNew time display command ('set time').
- X
- XAll PostScript devices were rewritten and merged into one (Color
- XPostscript is supported). Due to this many of the old postscript
- Xterminal driver names are not supported; only 'postscript' is
- Xrecognized. Use 'help set terminal postscript' to find out how to get
- Xyour old favorite back, and more.
- X
- XA 'gnuplot' mode for emacs in the file gnuplot.el.
- X
- XSGI device was improved.
- X
- XNew option to 'set arrow' called 'nohead'.
- X
- XList of all new commands:
- X-------------------------
- Xsplot
- X
- XList of all new set-show commands:
- X---------------------------------
- Xborder, cntrparam, contour, isosamples, mapping, rrange, surface,
- Xtime, view, zlabel, ztics, zrange.
- X
- XList of changed set-show commands:
- X----------------------------------
- Xarrow, terminal, title, xlabel, ylabel, zlabel
- X
- XNew terminal drivers:
- X---------------------
- Xvws, apollo, gpr apollo, dumb, BigFig, Super
- XVGA, ln03/hplj/hpdj, dxf.
- X
- XDeletions:
- X----------
- XThe gnut2p translator (translating gnutex to gnuplot) has been removed
- Xfrom the standard distribution. It is available for ftp separately at
- Xcs.duke.edu as dist/sources/gnuplot/gnut2p.tar.Z
- X
- XBug fixes include:
- X------------------
- XFix a bug in parametric type hangup.
- X
- XAdd a .sty file to fix indexing problem in manual.
- X
- XFix a bug in hpljii.
- X
- XFix a bug in FIG arrows.
- X
- X
- X ACKNOWLEDGEMENTS
- X
- X- New PostScript device by Russell Lang (rjl@monu1.cc.monash.edu.au).
- X- Several bug fixes, manual proofing, World Map by John Campbell
- X(campbell@nauvax.ucc.nau.edu).
- X- Eliminating samples from data files, lasergnu, and errorbars by
- XDavid Kotz (David.Kotz@Dartmouth.edu).
- X- New history and line editing capability for Unix and MSDOS, bivariate
- X functions and some bug fixes by Tom Tkacik (tkacik@hobbes.cs.gmr.com).
- X- New using x:y{:z} format by Dennis Linse (djlinse@phoenix.princeton.edu).
- X- Some polar enhancements, time display and some bug fixes by
- XAlex Woo (woo@ra-next.arc.nasa.gov).
- X- Dumb terminal by Francois Pinard (pinard@iro.umontreal.ca).
- X- VWS device by Walter Speth (speth@dbnpib5.bitnet).
- X- BigFig device by (ian@augean.ua.oz.au).
- X- XDF device by Florian Hiss (fhis1231@w204zrz.zrz.tu-berlin.de).
- X- HP Desk Jet device, overlay support for BCC and more efficient help
- Xand pc.trm for MSDOS by Maurice Castro and Russell Lang
- X(rjl@monu1.cc.monash.edu.au).
- X- New makefile scheme by Roque Donizete De Oliveira and David Kotz
- X(oliveria@caen.engin.umich.edu and David.Kotz@Dartmouth.edu).
- X- The 3d extensions, contouring, Super VGA device, and bringing this new
- Xversion up by Gershon Elber (gershon@cs.utah.edu).
- X
- XOther bug fixes/improvments:
- X= Tom Bopp (tbopp@uhunix.uhcc.hawaii.edu)
- X= Kenneth H. Carpenter (khc@eece.ksu.edu)
- X= Mark Christopher (christo@bnr.ca)
- X= Henk de Haan (haan@irimcf.tudelft.nl)
- X= David Gillespie (daveg@csvax.cs.caltech.edu)
- X
- XBeta testers:
- X+ John Campbell (campbell@nauvax.ucc.nau.edu)
- X+ Kenneth H. Carpenter (khc@eece.ksu.edu)
- X+ Gershon Elber (gershon@cs.utah.edu)
- X+ Pat Empleo (empleop@afal-edwards.af.mil)
- X+ David Kotz (dfk@moose.dartmouth.edu)
- X+ Russell Lang (rjl@monu1.cc.monash.edu.au)
- X+ Tom Tkacik (tkacik@hobbes.cs.gmr.com)
- X+ Roque Donizete De Oliveira (oliveria@caen.engin.umich.edu)
- X+ Walter Speth (Speth@dbnpib5.bitnet)
- X+ Carsten Steger (stegerc@gshalle2.informatik.tu-muenchen.de)
- X
- X============================================================================
- X
- X GNUPLOT 2.0 RELEASE NOTES
- X
- XNew terminal drivers: ATT6300, Roland DXY800A, EEPIC, emTeX, EPSON LX-800,
- XEPSON 60dpi, Fig, HP2648, HPGL, HP LaserJet, Imagen, Kermit-MS Tektronix
- Xemulator, LaTeX, MCGA, NEC CP6 pinwriter, POSTSCRIPT, Proprinter, Star color
- Xprinter, Tandy DMP-130, Tektronix 410x, SUN, VGA, X11.
- X
- XAdditions:
- X
- XCommand-line arguments are accepted. They are treated as names of
- Xfiles containing gnuplot commands. Gnuplot loads them, one by one, and
- Xthen exits.
- X
- XCommand 'plot' now has a 'title' option to change the information in
- Xthe key. The 'with' option can now specify line type and point type.
- X
- XCommand 'pause'.
- X
- XCommand 'replot' allows the addition of extra plots.
- X
- XCommand 'save' now saves all the 'set' options, including the last
- Xplot command.
- X
- XCommand 'set autoscale' now accepts autoscaling on the x axis for data
- Xfiles. The default is autoscaling on both axes.
- X
- XCommand 'set noclip' disables clipping of points near the border. 'set
- Xclip' reenables clipping. The default used to be 'clip', and is now
- X'noclip'. Clipping has also been extended to clip lines that extend
- Xoutside the borders: line plots are now clipped at the plot boundary.
- XFormerly, the line stopped at the last in-range data point.
- X
- XNumerical labelling at tic marks on x and y axes. Command 'set
- Xformat' allows the format of the tic mark labels to be altered.
- XCommands 'set xtics' and 'set ytics' allow for alphanumeric labels and
- Xarbitrary tic positions.
- X
- XCommand 'set grid' adds a grid between the tic marks.
- X
- XImproved key gives sample point or line types. Key can be disabled
- Xwith the 'set nokey'. Key can be positioned anywhere.
- X
- XCommand 'set label' allows the placement of arbitrary text labels and
- Xarrows.
- X
- XCommand 'set polar' for polar plots.
- X
- XCommand 'set offsets' for reducing the plotted area. Useful for polar
- Xplots.
- X
- XCommand 'set size' scales the displayed size of the plot.
- X
- XCommand 'set tics out' causes the tics to be drawn outwards from the
- Xborder. Useful for impulse plots.
- X
- XCommand 'set title' places a text label above the plot.
- X
- XCommands 'set xlabel' and 'set ylabel' place text labels on the x and
- Xy axes respectively. Some terminals will place the y label vertically
- Xupwards on the left of the plot, others place the label horizontally
- Xat the left of the plot.
- X
- XImproved tics on log scales.
- X
- XExtended comments: comments are allowed anywhere reasonable in the
- Xinput line, and continue to the end of the input line.
- X
- XLine continuation (with \) is added.
- X
- XNon-interactive use, through redirection or "load" command, is
- Ximproved. Error messages expanded to include file name and line
- Xnumber, and to reprint command line if not interactive.
- X
- XNew plotting styles 'linespoints' and 'dots'.
- X
- XBlank lines in data files denote "breaks". In lines and linespoints
- Xplot styles, this breaks the curve being drawn and begins at the next
- Xpoint, without changing the line or point types.
- X
- XCompletely new interactive help system that is similar to VMS help
- Xsystem. A printed manual can be obtained in LaTeX, troff, or nroff and
- Xis based on the same information as the interactive help.
- X
- XPC version now compiles with the large model so that gnuplot will
- Xcompile with the above additions!
- X
- XBug fixes include:
- X------------------
- XBug involving functions plotted on a logarithmic x axis is fixed.
- X
- XErrors inside of loaded files now clean up and close files properly.
- X
- XNumbers of the form xxxxe+nn are now acceptable (+ sign caused error).
- X
- XTics are now place inside the borders (some were outside).
- X
- XReverse axes now work properly.
- X
- XCommand 'set output ""' used to crash.
- X
- XVMS was closing stdout, so 'set output' code changed to avoid closing
- Xit. VMS version of gnuplot now performs a SET TERM/NOWRAP itself.
- X
- XTerminal is now reset before closing output file, changing terminal
- Xtype or exiting gnuplot.
- X
- XSeveral old bugs have been superseded by new ones.
- X
- X
- X ACKNOWLEDGEMENTS
- X
- XThe Unix PC, polar, pause, and offset additions were by John Campbell.
- X(CAMPBELL@NAUVAX.bitnet)
- XThe Turbo C additions were by Bill Wilson.
- X(WILSON@NAUVAX.bitnet)
- XSome of the labelling improvements and combining of these additions
- Xwere by Russell Lang.
- X(rjl@monu1.cc.monash.oz.au)
- XThe LaTeX driver, the help system, and some of the labelling
- Ximprovements were by David Kotz.
- X(David.Kotz@Dartmouth.edu)
- XAnd of course, the vast majority of the program is by Colin Kelley
- Xand Thomas Williams.
- X(info-gnuplot@dartmouth.edu)
- X
- X=======================================================================
- X
- X GNUPLOT 1.1 RELEASE NOTES
- X
- XNew terminal drivers: AED 512, BBN BitGraph, HP2623, POSTSCRIPT,
- XSelanar, Vectrix 384. The PC version now supports Hercules and ATT
- X6300 monochrome graphics. Thanks to those who sent these drivers in.
- X
- XNew commands: 'set dummy' and 'show dummy' to select the dummy
- Xvariable name; 'replot' to repeat the last 'plot' command.
- X
- XThe exclamation point (!) is now accepted as postfix factorial
- Xoperator. The gamma() function is also included, if your C library
- Xhas gamma(). See GAMMA below.
- X
- XLogical AND (&&) and OR (||) now short-circuit the way they do in C.
- XThat is, the second && operand is not evaluated if the first is false;
- Xthe second || operand is not evaluated if the first is true. The
- Xternary operator (?:) also does not evaluate the unused operand. This
- Xchange allows for the definition of recursive functions, e.g. a
- Xsynonym for the ! factorial operator:
- X
- X fact(x) = (x<=1) ? 1 : x*fact(x-1)
- X
- XGNUPLOT now has a much better memory allocation scheme, replacing most
- Xfixed-size arrays with malloc()'d linked lists. There is no longer
- Xany artificial maximum on the number of simultaneous plots, number of
- Xpoints in those plots, or the number of user-defined functions or
- Xvariables. All these are limited only by the memory available to
- Xmalloc(). This is a big improvement for memory-starved machines like
- XPDP-11s or PCs.
- X
- XLines beginning with # (also ! in VMS) are treated as comments. Only
- Xthe $ may now be used for a shell escape in VMS, since ! is a comment.
- X
- XSeveral old bugs have been superseded by new ones.
- END_OF_FILE
- if test 10765 -ne `wc -c <'gnuplot/History'`; then
- echo shar: \"'gnuplot/History'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/History'
- fi
- if test -f 'gnuplot/demo/world.dat' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/demo/world.dat'\"
- else
- echo shar: Extracting \"'gnuplot/demo/world.dat'\" \(16782 characters\)
- sed "s/^X//" >'gnuplot/demo/world.dat' <<'END_OF_FILE'
- X#
- X# $Id: world.dat 3.38.2.6 1992/11/14 02:25:21 woo Exp $
- X#
- X#
- X-140.37 60.25
- X-132.08 57.20
- X-131.46 55.98
- X-133.84 57.12
- X-136.01 59.12
- X-137.12 58.28
- X-139.98 59.73
- X-146.54 60.36
- X-149.90 59.50
- X-149.18 60.81
- X-153.53 59.32
- X-156.52 57.11
- X-162.34 55.06
- X-157.85 58.12
- X-162.06 58.36
- X-164.58 60.06
- X-165.29 62.57
- X-161.12 64.49
- X-168.23 65.49
- X-162.99 65.97
- X-161.56 66.55
- X-166.64 68.25
- X-159.53 70.38
- X-154.37 70.96
- X-148.09 70.26
- X-142.49 69.83
- X-141.21 69.56
- X
- X-152.62 58.41
- X-152.60 58.40
- X
- X-153.30 57.80
- X-152.40 57.48
- X-153.32 57.79
- X
- X-166.96 53.96
- X-167.01 53.95
- X
- X-168.36 53.50
- X-168.19 53.36
- X
- X-170.73 52.68
- X-170.60 52.55
- X
- X-174.47 51.94
- X-174.47 51.92
- X
- X-176.58 51.71
- X-176.64 51.73
- X
- X-177.55 51.76
- X-177.41 51.63
- X
- X-178.27 51.75
- X
- X177.35 51.80
- X177.33 51.76
- X
- X172.44 53.00
- X172.55 53.03
- X
- X-141.21 60.16
- X-133.38 58.93
- X-130.88 54.83
- X-128.86 53.90
- X-126.58 52.12
- X-127.08 50.80
- X-124.42 49.66
- X-122.56 48.91
- X
- X-92.32 48.24
- X-88.13 48.92
- X-83.11 46.27
- X-81.66 44.76
- X-82.09 42.29
- X-77.10 44.00
- X-69.95 46.92
- X-65.92 45.32
- X-66.37 44.25
- X-61.22 45.43
- X-64.94 47.34
- X-64.12 48.52
- X-70.68 47.02
- X-67.24 49.33
- X-59.82 50.48
- X-56.14 52.46
- X-59.07 53.58
- X-58.26 54.21
- X-60.69 55.33
- X-61.97 57.41
- X-64.35 59.49
- X-67.29 58.15
- X-69.89 59.91
- X-71.31 61.45
- X-78.22 61.97
- X-77.28 59.53
- X-77.09 55.88
- X-79.06 51.68
- X-82.23 52.70
- X-86.75 55.72
- X-92.17 56.86
- X-95.61 58.82
- X-92.66 62.02
- X-90.65 63.24
- X-95.96 64.12
- X-89.88 63.98
- X-89.30 65.22
- X-86.86 66.12
- X-84.54 66.88
- X-82.30 67.76
- X-83.10 69.68
- X-86.05 67.98
- X-88.18 68.20
- X-91.00 68.82
- X-91.72 69.69
- X-93.15 71.09
- X-96.58 71.05
- X-93.35 69.52
- X-94.23 68.25
- X-95.96 66.73
- X-98.83 68.27
- X-102.45 67.69
- X-108.34 68.43
- X-105.83 68.05
- X-108.15 66.60
- X-111.15 67.63
- X-114.10 68.23
- X-120.92 69.44
- X-124.32 69.26
- X-128.76 70.50
- X-131.86 69.19
- X-131.15 69.79
- X-135.81 69.13
- X-140.19 69.37
- X-141.20 69.58
- X
- X-123.40 48.33
- X-128.00 50.84
- X-123.50 48.34
- X
- X-132.49 52.88
- X-132.44 52.91
- X
- X-132.64 53.02
- X-131.97 53.71
- X-132.63 53.02
- X
- X-55.36 51.56
- X-54.66 49.52
- X-53.65 47.48
- X-52.98 46.31
- X-56.12 46.84
- X-58.47 47.57
- X-57.61 50.38
- X-55.39 51.53
- X
- X-61.37 49.01
- X-61.80 49.29
- X-61.38 49.03
- X
- X-63.01 46.71
- X-64.42 46.61
- X-63.04 46.68
- X
- X-60.14 46.48
- X-60.14 46.50
- X
- X-122.44 48.92
- X-124.42 47.18
- X-124.52 42.48
- X-123.09 38.45
- X-121.73 36.62
- X-117.60 33.34
- X-117.28 32.64
- X
- X-97.62 25.82
- X-95.62 28.84
- X-90.77 29.03
- X-87.33 30.22
- X-82.69 28.15
- X-80.16 26.66
- X-80.74 32.31
- X-76.89 35.43
- X-76.47 38.21
- X-75.66 37.67
- X-71.31 41.76
- X-69.44 44.17
- X-67.69 47.03
- X-73.18 45.14
- X-79.26 43.28
- X-82.84 42.59
- X-83.49 45.32
- X-86.36 43.65
- X-87.75 43.42
- X-86.01 45.96
- X-87.00 46.59
- X-91.39 46.79
- X-90.05 47.96
- X
- X-71.97 41.11
- X-71.97 41.15
- X
- X-80.79 27.03
- X-81.01 26.99
- X
- X-113.01 42.09
- X-113.10 42.01
- X
- X-155.74 20.02
- X-155.73 19.98
- X
- X-156.51 20.78
- X-156.51 20.78
- X
- X-157.12 21.21
- X-157.08 20.95
- X
- X-157.87 21.42
- X
- X-159.53 22.07
- X
- X-117.44 66.46
- X-119.59 65.24
- X-123.95 65.03
- X-123.69 66.44
- X-119.21 66.22
- X-117.44 66.44
- X
- X-120.71 64.03
- X-114.91 62.30
- X-109.07 62.72
- X-112.62 61.19
- X-118.68 61.19
- X-117.01 61.17
- X-115.97 62.56
- X-119.46 64.00
- X-120.59 63.94
- X
- X-112.31 58.46
- X-108.90 59.44
- X-104.14 58.90
- X-102.56 56.72
- X-101.82 58.73
- X-104.65 58.91
- X-111.00 58.51
- X-112.35 58.62
- X
- X-98.74 50.09
- X-99.75 52.24
- X-99.62 51.47
- X-98.82 50.39
- X
- X-97.02 50.21
- X-97.50 54.02
- X-98.69 52.93
- X-97.19 51.09
- X-96.98 50.20
- X
- X-95.34 49.04
- X-92.32 50.34
- X-94.14 49.47
- X-95.36 48.82
- X
- X-80.39 56.16
- X-79.22 55.94
- X-80.34 56.08
- X
- X-103.56 58.60
- X-103.60 58.58
- X
- X-101.82 58.03
- X-102.33 58.10
- X-101.77 58.06
- X
- X-101.88 55.79
- X-97.92 57.15
- X-101.22 55.85
- X-101.88 55.74
- X
- X-117.29 32.48
- X-114.75 27.80
- X-112.53 24.80
- X-110.55 24.07
- X-114.23 29.59
- X-112.58 29.99
- X-109.57 25.94
- X-105.61 21.94
- X-102.09 17.87
- X-95.75 15.94
- X-92.21 14.97
- X
- X-88.45 17.42
- X-87.01 21.33
- X-91.65 18.72
- X-96.96 20.37
- X-97.65 25.67
- X
- X-92.22 14.71
- X-86.74 12.06
- X-83.03 8.65
- X-79.93 8.74
- X-77.17 7.94
- X-81.99 8.97
- X-83.92 12.70
- X-86.33 15.80
- X-88.40 15.92
- X
- X-77.61 6.80
- X-78.70 0.97
- X-80.75 -4.47
- X-76.19 -14.57
- X-70.44 -18.75
- X-70.68 -26.15
- X-71.44 -32.03
- X-73.38 -37.27
- X-73.06 -42.11
- X-73.17 -46.09
- X-73.52 -48.05
- X-73.67 -51.56
- X-71.06 -53.88
- X-69.14 -50.77
- X-67.51 -46.59
- X-63.49 -42.80
- X-62.14 -40.16
- X-57.12 -36.71
- X-53.17 -34.15
- X-51.26 -32.02
- X-48.16 -25.48
- X-40.73 -22.32
- X-38.88 -15.24
- X-34.60 -7.81
- X-41.95 -3.42
- X-48.02 -1.84
- X-48.44 -1.57
- X-50.81 0.00
- X-54.47 5.39
- X-60.59 8.32
- X-64.19 9.88
- X-70.78 10.64
- X-70.97 11.89
- X-76.26 8.76
- X-77.61 6.80
- X
- X-69.14 -52.79
- X-66.16 -55.08
- X-70.01 -54.88
- X-70.55 -53.85
- X-69.31 -52.81
- X
- X-59.29 -51.58
- X-59.35 -51.54
- X
- X-58.65 -51.55
- X-58.55 -51.56
- X
- X-84.39 21.44
- X-73.90 19.73
- X-79.27 21.18
- X-83.74 21.80
- X-84.32 21.42
- X
- X-66.96 17.95
- X-67.05 17.89
- X
- X-77.88 17.22
- X-78.06 16.98
- X
- X-74.47 18.08
- X-69.88 18.99
- X-71.10 17.76
- X-74.45 17.86
- X
- X-85.28 73.74
- X-85.79 70.96
- X-85.13 71.94
- X-84.74 72.96
- X-80.61 73.10
- X-78.45 72.20
- X-75.44 72.55
- X-73.89 71.98
- X-72.56 71.04
- X-71.49 70.57
- X-69.78 70.29
- X-68.12 69.71
- X-65.91 69.19
- X-66.92 68.39
- X-64.08 67.68
- X-62.50 66.68
- X-63.07 65.33
- X-66.11 66.08
- X-67.48 65.41
- X-64.05 63.15
- X-66.58 63.26
- X-69.04 62.33
- X-72.22 63.77
- X-76.88 64.17
- X-73.25 65.54
- X-70.09 66.64
- X-72.05 67.44
- X-76.32 68.36
- X-78.34 70.17
- X-82.12 69.71
- X-87.64 70.12
- X-89.68 71.43
- X-85.28 73.74
- X
- X-80.90 76.10
- X-84.21 76.28
- X-88.94 76.38
- X-85.47 77.40
- X-85.43 77.93
- X-87.01 78.54
- X-83.17 78.94
- X-84.87 79.93
- X-81.33 79.82
- X-76.27 80.92
- X-82.88 80.62
- X-82.58 81.16
- X-86.51 81.05
- X-89.36 81.21
- X-90.45 81.38
- X-89.28 81.86
- X-87.21 82.30
- X-80.51 82.05
- X-80.16 82.55
- X-77.83 82.86
- X-75.51 83.05
- X-71.18 82.90
- X-65.10 82.78
- X-63.34 81.80
- X-68.26 81.26
- X-69.46 80.34
- X-71.05 79.82
- X-74.40 79.46
- X-75.42 79.03
- X-75.48 78.92
- X-76.01 78.20
- X-80.66 77.28
- X-78.07 76.98
- X-80.90 76.13
- X
- X-92.86 74.13
- X-92.50 72.70
- X-94.89 73.16
- X-92.96 74.14
- X
- X-94.80 76.95
- X-89.68 76.04
- X-88.52 75.40
- X-82.36 75.67
- X-79.39 74.65
- X-86.15 74.22
- X-91.70 74.94
- X-95.60 76.91
- X-94.87 76.96
- X
- X-99.96 73.74
- X-97.89 72.90
- X-98.28 71.13
- X-102.04 72.92
- X-101.34 73.14
- X-99.69 73.59
- X
- X-107.58 73.25
- X-104.59 71.02
- X-101.71 69.56
- X-104.07 68.62
- X-106.61 69.12
- X-114.09 69.05
- X-113.89 70.12
- X-115.88 70.32
- X-116.10 71.32
- X-117.45 72.48
- X-113.53 72.44
- X-109.84 72.24
- X-106.62 71.71
- X-107.43 73.04
- X
- X-120.96 74.29
- X-118.37 72.53
- X-123.06 71.18
- X-123.40 73.77
- X-120.93 74.27
- X
- X-108.83 76.74
- X-106.25 75.54
- X-107.08 74.78
- X-112.99 74.16
- X-112.28 74.99
- X-116.04 75.33
- X-115.27 76.20
- X-110.95 75.56
- X-109.77 76.31
- X-108.82 76.70
- X
- X-115.70 77.46
- X-118.10 76.30
- X-121.13 76.37
- X-116.04 77.28
- X
- X-110.01 77.86
- X-112.36 77.68
- X-109.96 77.86
- X
- X-109.60 78.48
- X-112.20 78.01
- X-109.60 78.48
- X
- X-97.87 76.61
- X-99.21 75.31
- X-100.86 75.60
- X-99.40 76.26
- X-97.79 76.60
- X
- X-94.72 75.53
- X-94.66 75.52
- X
- X-104.10 79.01
- X-99.19 77.54
- X-103.22 78.08
- X-104.30 78.95
- X
- X-93.74 77.52
- X-93.74 77.52
- X
- X-96.88 78.50
- X-96.91 77.77
- X-96.94 78.48
- X
- X-84.69 65.84
- X-81.58 63.87
- X-85.00 62.96
- X-84.63 65.71
- X
- X-81.84 62.75
- X-82.01 62.63
- X
- X-79.88 62.12
- X-79.88 62.12
- X
- X-43.53 59.89
- X-45.29 60.67
- X-47.91 60.83
- X-49.90 62.41
- X-50.71 64.42
- X-51.39 64.94
- X-52.96 66.09
- X-53.62 67.19
- X-53.51 67.51
- X-51.84 68.65
- X-52.19 70.00
- X-51.85 71.03
- X-55.41 71.41
- X-54.63 72.97
- X-56.98 74.70
- X-61.95 76.09
- X-66.38 75.83
- X-71.13 77.00
- X-66.81 77.60
- X-70.78 77.78
- X-64.96 79.70
- X-63.38 81.16
- X-56.89 82.17
- X-48.18 82.15
- X-42.08 82.74
- X-38.02 83.54
- X-23.96 82.94
- X-25.97 81.97
- X-25.99 80.64
- X-13.57 80.97
- X-16.60 80.16
- X-19.82 78.82
- X-18.80 77.54
- X-21.98 76.46
- X-20.69 75.12
- X-21.78 74.40
- X-24.10 73.69
- X-26.54 73.08
- X-24.63 72.69
- X-21.84 71.69
- X-24.62 71.24
- X-27.16 70.89
- X-27.21 70.00
- X-24.10 69.35
- X-28.35 68.43
- X-32.48 68.56
- X-35.26 66.26
- X-37.90 65.90
- X-40.04 65.00
- X-40.49 64.04
- X-42.01 63.14
- X-42.88 61.15
- X-43.09 60.07
- X-43.56 59.90
- X
- X-16.26 66.41
- X-15.32 64.29
- X-20.14 63.47
- X-21.76 64.21
- X-21.33 64.97
- X-23.04 65.62
- X-21.76 66.26
- X-18.77 66.12
- X-16.23 66.35
- X
- X 0.56 51.47
- X -1.71 54.94
- X -3.41 57.52
- X -5.42 58.14
- X -5.77 55.59
- X -3.48 54.82
- X -4.68 52.88
- X -2.68 51.58
- X -3.80 50.08
- X 1.26 51.14
- X 0.65 51.41
- X
- X -7.17 54.91
- X -9.97 53.47
- X -8.52 51.76
- X -5.69 54.79
- X -7.34 55.25
- X
- X -1.33 60.66
- X -1.17 60.38
- X
- X -6.18 58.44
- X -6.09 58.36
- X
- X -6.47 57.58
- X -6.33 57.54
- X
- X -7.30 57.54
- X
- X -7.46 57.05
- X
- X -6.54 56.94
- X
- X -6.00 55.94
- X
- X -5.09 55.55
- X
- X -4.44 54.38
- X -4.30 54.19
- X
- X -8.08 71.02
- X -8.21 70.86
- X
- X 16.92 79.52
- X 22.26 78.46
- X 16.86 76.41
- X 16.00 77.39
- X 16.03 77.92
- X 16.81 79.50
- X
- X 14.71 79.40
- X 16.05 79.12
- X 14.02 77.80
- X 13.56 78.46
- X 12.63 79.26
- X 14.68 79.40
- X
- X 22.01 78.24
- X 21.86 78.23
- X
- X 21.54 77.75
- X 23.88 77.26
- X 21.53 77.67
- X 22.79 77.79
- X
- X 23.50 79.97
- X 28.24 79.54
- X 20.85 78.94
- X 19.00 79.34
- X 21.05 79.88
- X 23.41 79.96
- X
- X 46.98 80.23
- X 43.13 79.97
- X 47.18 80.22
- X
- X 50.43 80.19
- X 50.55 79.88
- X 47.77 79.86
- X 50.45 80.14
- X
- X 61.79 80.18
- X 61.79 80.18
- X
- X 65.08 80.69
- X 64.27 80.59
- X 65.13 80.68
- X
- X -5.13 35.66
- X 4.06 36.63
- X 10.40 37.12
- X 11.36 33.61
- X 20.10 30.10
- X 23.49 32.17
- X 31.65 30.80
- X 35.76 23.74
- X 39.75 14.82
- X 42.93 11.34
- X 51.52 11.45
- X 49.82 6.99
- X 43.13 -0.62
- X 39.15 -7.58
- X 40.37 -13.20
- X 37.74 -18.17
- X 35.33 -22.71
- X 32.84 -28.15
- X 26.50 -34.39
- X 19.55 -35.51
- X 17.50 -30.88
- X 12.24 -18.75
- X 13.89 -12.81
- X 12.05 -5.55
- X 9.67 0.14
- X 7.19 3.79
- X 1.74 5.39
- X -4.77 4.59
- X-12.00 6.75
- X-15.54 10.98
- X-16.33 15.50
- X-16.10 22.29
- X-12.90 27.12
- X -9.52 31.09
- X -5.41 35.58
- X
- X 33.71 0.00
- X 33.48 -3.42
- X 33.34 -0.20
- X 33.71 0.00
- X
- X 49.30 -12.50
- X 49.28 -18.79
- X 43.95 -25.50
- X 44.37 -20.08
- X 46.34 -16.31
- X 47.91 -14.08
- X 49.30 -12.50
- X
- X 32.18 30.58
- X 36.08 35.03
- X 32.53 36.17
- X 27.77 36.94
- X 26.51 39.18
- X 31.54 40.82
- X 38.53 40.48
- X 40.35 43.17
- X 39.88 46.45
- X 35.18 44.99
- X 33.50 44.96
- X 30.24 45.14
- X 28.70 41.48
- X 26.55 39.84
- X 23.62 39.67
- X 23.80 37.34
- X 21.90 36.92
- X 18.79 42.02
- X 14.52 44.31
- X 14.58 42.25
- X 18.32 39.57
- X 16.05 39.35
- X 11.52 42.36
- X 6.87 43.08
- X 2.80 41.09
- X -1.11 37.14
- X -6.24 36.70
- X -8.67 39.57
- X -6.51 43.13
- X -0.84 45.55
- X -3.93 48.40
- X 0.48 49.09
- X 4.20 51.29
- X 6.44 52.92
- X 8.42 55.94
- X 11.72 55.49
- X 11.73 53.66
- X 16.78 54.14
- X 21.40 56.32
- X 24.67 57.20
- X 28.94 59.18
- X 24.16 59.52
- X 22.07 62.66
- X 23.76 65.35
- X 18.70 62.54
- X 19.11 59.67
- X 18.40 58.54
- X 15.34 55.73
- X 11.74 58.08
- X 8.37 57.68
- X 5.80 59.20
- X 7.38 60.86
- X 7.51 61.86
- X 9.62 62.99
- X 13.37 65.46
- X 15.46 67.12
- X 18.54 68.62
- X 22.32 69.64
- X 24.77 70.17
- X 25.93 69.79
- X 28.56 70.46
- X 29.75 69.76
- X 33.83 69.11
- X 41.90 66.85
- X 35.14 66.25
- X 33.30 66.07
- X 35.46 64.15
- X 37.68 64.03
- X 41.71 64.09
- X 44.80 65.58
- X 44.87 68.16
- X 45.92 66.83
- X 51.79 67.85
- X 53.70 67.89
- X 59.68 68.09
- X 65.07 69.08
- X 68.56 69.19
- X 68.38 70.97
- X 73.03 71.62
- X 73.80 68.29
- X 69.42 66.45
- X 73.43 66.36
- X 77.51 68.36
- X 80.74 66.74
- X 75.27 68.67
- X 75.11 71.80
- X 78.62 70.56
- X 78.43 71.90
- X 82.72 71.23
- X 84.25 70.03
- X 81.40 72.76
- X 86.50 74.01
- X 87.68 74.78
- X 90.25 75.23
- X
- X 68.33 76.71
- X 66.03 75.62
- X 59.10 74.11
- X 54.92 73.03
- X 56.67 74.10
- X 58.56 75.09
- X 63.86 75.87
- X 68.19 76.70
- X
- X 53.04 72.57
- X 58.29 70.39
- X 55.03 70.78
- X 53.44 72.26
- X 53.63 72.61
- X
- X 90.06 21.03
- X 82.06 15.95
- X 80.05 11.72
- X 76.41 8.60
- X 72.79 17.43
- X 72.02 20.00
- X 68.98 21.99
- X 64.62 24.41
- X 57.83 24.77
- X 53.11 26.20
- X 49.67 29.41
- X 50.96 25.15
- X 54.33 23.44
- X 59.03 22.57
- X 57.87 18.86
- X 52.95 15.74
- X 47.26 12.96
- X 42.75 14.68
- X 39.93 19.61
- X 36.92 25.78
- X 33.30 28.46
- X 32.60 30.63
- X
- X 52.22 46.50
- X 51.73 44.73
- X 52.56 41.80
- X 53.43 40.40
- X 54.22 37.86
- X 49.04 38.45
- X 48.17 42.76
- X 49.33 45.64
- X 52.22 46.50
- X
- X 62.32 46.32
- X 60.32 43.06
- X 59.57 45.58
- X 61.94 46.33
- X
- X 79.55 46.12
- X 74.30 44.44
- X 78.62 45.79
- X 79.66 46.07
- X
- X 76.81 41.96
- X 76.73 41.86
- X
- X 35.15 35.15
- X 34.61 34.84
- X 35.18 35.17
- X
- X 23.84 35.33
- X 24.30 34.91
- X 24.09 35.39
- X
- X 15.54 37.89
- X 13.47 37.89
- X 15.54 37.89
- X
- X 9.56 40.95
- X 8.46 39.99
- X 9.12 40.69
- X
- X 9.72 42.60
- X 9.54 42.35
- X
- X 80.60 8.95
- X 79.73 5.96
- X 80.10 8.30
- X
- X 11.04 57.44
- X 10.67 57.25
- X
- X-77.92 24.67
- X-77.98 24.22
- X
- X-77.61 23.62
- X-77.18 23.64
- X
- X-75.55 24.13
- X-75.41 24.31
- X
- X-91.40 -0.17
- X-91.52 -0.26
- X
- X-60.25 46.68
- X-60.71 46.33
- X
- X-63.89 49.47
- X-63.45 49.43
- X
- X142.53 -10.60
- X145.62 -16.34
- X149.79 -22.09
- X153.21 -26.82
- X150.52 -35.19
- X145.60 -38.53
- X140.13 -37.69
- X137.34 -34.77
- X135.76 -34.56
- X131.50 -31.34
- X121.72 -33.65
- X115.62 -33.25
- X114.09 -26.01
- X114.88 -21.27
- X122.34 -18.13
- X125.32 -14.53
- X128.39 -14.90
- X132.35 -11.42
- X136.16 -12.43
- X138.07 -16.45
- X142.25 -10.78
- X
- X144.72 -40.68
- X148.32 -42.14
- X145.57 -42.77
- X146.47 -41.19
- X
- X172.86 -34.23
- X176.10 -37.52
- X177.06 -39.49
- X174.77 -38.03
- X172.83 -34.27
- X
- X172.36 -40.53
- X172.92 -43.81
- X168.41 -46.13
- X170.26 -43.21
- X173.69 -40.94
- X
- X150.74 -10.18
- X143.04 -8.26
- X138.48 -6.97
- X131.95 -2.94
- X130.91 -1.35
- X134.38 -2.64
- X141.24 -2.62
- X148.19 -8.15
- X150.75 -10.27
- X
- X117.24 7.01
- X117.90 0.76
- X113.89 -3.50
- X109.44 -0.82
- X113.13 3.38
- X117.24 7.01
- X
- X 95.31 5.75
- X102.32 1.40
- X106.03 -2.98
- X101.46 -2.81
- X 95.20 5.73
- X
- X140.91 41.53
- X140.79 35.75
- X136.82 34.56
- X133.56 34.72
- X132.49 35.41
- X136.73 37.20
- X139.82 40.00
- X140.68 41.43
- X
- X133.71 34.30
- X131.41 31.58
- X129.38 33.10
- X133.90 34.37
- X
- X141.89 45.50
- X144.12 42.92
- X140.30 41.64
- X141.53 45.30
- X141.89 45.53
- X
- X142.57 54.36
- X143.64 49.19
- X141.99 45.88
- X141.92 50.85
- X142.60 54.34
- X
- X121.92 25.48
- X120.53 24.70
- X121.70 25.51
- X
- X110.81 20.07
- X109.20 19.66
- X110.81 20.07
- X
- X106.51 -6.16
- X114.15 -7.72
- X108.71 -7.89
- X106.51 -6.16
- X
- X164.27 -20.01
- X164.16 -20.27
- X
- X178.61 -17.04
- X178.61 -17.04
- X
- X179.45 -16.43
- X179.35 -16.43
- X
- X-172.55 -13.39
- X-172.61 -13.78
- X
- X122.26 18.67
- X123.05 13.86
- X120.73 13.80
- X120.43 16.43
- X121.72 18.40
- X
- X125.34 9.79
- X125.56 6.28
- X122.38 7.00
- X125.10 9.38
- X
- X119.64 11.35
- X118.81 10.16
- X119.59 10.86
- X
- X 90.05 21.74
- X 94.21 17.79
- X 97.66 15.36
- X 98.21 9.17
- X103.22 1.56
- X100.26 8.30
- X100.01 13.52
- X104.39 10.37
- X107.32 10.45
- X107.55 16.34
- X108.53 21.73
- X112.69 21.81
- X118.83 24.93
- X121.28 30.25
- X120.73 32.65
- X121.77 36.90
- X117.58 38.21
- X121.62 40.15
- X125.12 39.08
- X126.15 35.18
- X128.33 38.46
- X129.92 42.04
- X138.77 47.30
- X140.72 52.43
- X137.10 54.07
- X140.77 58.39
- X148.57 59.46
- X153.83 59.10
- X156.81 61.68
- X159.90 60.73
- X163.79 61.73
- X156.40 57.76
- X156.42 51.09
- X161.82 54.88
- X162.92 57.34
- X164.48 59.89
- X170.42 60.17
- X177.46 62.62
- X178.20 64.29
- X179.48 64.88
- X
- X-179.87 65.14
- X-177.13 65.63
- X-173.46 64.74
- X-171.13 66.38
- X-176.48 67.78
- X-178.80 68.42
- X
- X178.88 69.10
- X170.20 69.99
- X167.68 69.63
- X159.92 70.14
- X150.77 71.28
- X146.92 72.21
- X146.04 72.39
- X139.60 72.23
- X135.49 71.51
- X130.53 70.86
- X126.10 72.24
- X128.94 73.02
- X123.10 73.28
- X113.34 73.37
- X110.43 73.71
- X107.88 73.72
- X112.99 75.60
- X106.34 76.40
- X104.10 77.52
- X 99.69 76.09
- X 95.12 75.95
- X 89.68 75.57
- X
- X101.96 79.08
- X101.31 77.86
- X101.22 79.04
- X
- X 94.29 79.29
- X100.02 79.43
- X 95.31 78.68
- X 95.44 79.65
- X 97.26 79.62
- X
- X 95.46 80.62
- X 92.39 79.66
- X 95.07 80.54
- X
- X 91.39 79.62
- X 91.33 79.62
- X
- X138.54 76.05
- X144.93 75.45
- X140.30 74.99
- X137.27 75.44
- X138.29 75.98
- X
- X146.08 75.29
- X147.75 74.73
- X145.85 75.06
- X
- X141.44 73.88
- X141.48 73.84
- X
- X 0.01 -71.68
- X 6.57 -70.57
- X 15.04 -70.44
- X 25.10 -70.75
- X 33.37 -69.10
- X 38.46 -69.77
- X 42.85 -68.16
- X 46.59 -67.23
- X 49.35 -66.96
- X 52.90 -65.97
- X 58.46 -67.20
- X 63.60 -67.58
- X 70.63 -68.41
- X 69.24 -70.36
- X 76.20 -69.44
- X 88.08 -66.64
- X 94.98 -66.52
- X101.53 -66.09
- X111.31 -65.91
- X118.64 -66.87
- X126.24 -66.24
- X133.09 -66.18
- X139.85 -66.72
- X146.86 -67.96
- X153.65 -68.82
- X159.94 -69.57
- X164.10 -70.67
- X170.19 -71.94
- X165.68 -74.64
- X163.82 -77.60
- X162.10 -78.95
- X166.72 -82.84
- X175.58 -83.86
- X
- X-178.56 -84.37
- X-147.96 -85.40
- X-152.96 -81.12
- X-153.95 -79.50
- X-151.24 -77.48
- X-146.74 -76.44
- X-137.68 -75.16
- X-131.63 -74.63
- X-123.05 -74.41
- X-114.76 -73.97
- X-111.91 -75.41
- X-105.05 -74.77
- X-100.90 -74.21
- X-101.04 -73.18
- X-100.28 -73.06
- X-93.06 -73.33
- X-85.40 -73.18
- X-79.82 -73.04
- X-78.21 -72.52
- X-71.90 -73.41
- X-67.51 -71.10
- X-67.57 -68.92
- X-66.65 -66.83
- X-64.30 -65.28
- X-59.14 -63.74
- X-59.58 -64.37
- X-62.50 -65.94
- X-62.48 -66.66
- X-65.64 -68.02
- X-63.85 -69.07
- X-61.69 -70.87
- X-60.89 -72.71
- X-61.07 -74.30
- X-63.33 -75.88
- X-76.05 -77.06
- X-83.04 -77.12
- X-74.30 -80.83
- X-56.40 -82.14
- X-42.46 -81.65
- X-31.60 -80.17
- X-34.01 -79.20
- X-32.48 -77.28
- X-26.28 -76.18
- X-17.18 -73.45
- X-11.20 -72.01
- X -8.67 -71.98
- X -5.45 -71.45
- X -0.82 -71.74
- X 0.07 -71.68
- X
- X164.65 -77.89
- X170.95 -77.37
- X179.67 -78.25
- X
- X-178.74 -78.24
- X-165.76 -78.47
- X-158.42 -77.73
- X
- X-58.98 -64.63
- X-60.99 -68.62
- X-61.02 -71.70
- X
- X-62.01 -74.94
- X-52.00 -77.07
- X-42.23 -77.80
- X-36.22 -78.03
- X
- X-35.03 -77.81
- X-26.13 -75.54
- X-19.35 -73.04
- X-12.16 -71.86
- X -6.15 -70.65
- X -0.57 -69.14
- X 4.93 -70.25
- X 10.91 -69.99
- X 16.52 -69.87
- X 25.41 -70.22
- X 32.13 -69.29
- X 33.62 -69.58
- X
- X 70.56 -68.53
- X 73.91 -69.51
- X
- X 81.42 -67.87
- X 84.67 -66.41
- X 89.07 -66.73
- X
- X-135.79 -74.67
- X-124.34 -73.22
- X-116.65 -74.08
- X-109.93 -74.64
- X-105.36 -74.56
- X-105.83 -74.77
- X
- X-69.30 -70.06
- X-71.33 -72.68
- X-71.42 -71.85
- X-75.10 -71.46
- X-71.79 -70.55
- X-70.34 -69.26
- X-69.34 -70.13
- X
- X-49.20 -77.83
- X-44.59 -78.79
- X-44.14 -80.13
- X-59.04 -79.95
- X-49.28 -77.84
- X-48.24 -77.81
- X
- X-58.13 -80.12
- X-63.25 -80.20
- X-58.32 -80.12
- X
- X-163.64 -78.74
- X-161.20 -79.93
- X-163.62 -78.74
- X
- X 66.82 66.82
- X 66.82 66.82
- X
- END_OF_FILE
- if test 16782 -ne `wc -c <'gnuplot/demo/world.dat'`; then
- echo shar: \"'gnuplot/demo/world.dat'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/demo/world.dat'
- fi
- if test -f 'gnuplot/docs/latextut/tutorial.tex' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/docs/latextut/tutorial.tex'\"
- else
- echo shar: Extracting \"'gnuplot/docs/latextut/tutorial.tex'\" \(16602 characters\)
- sed "s/^X//" >'gnuplot/docs/latextut/tutorial.tex' <<'END_OF_FILE'
- X%
- X% Tutorial for GNUPLOT plotting program, for LaTeX users
- X% David Kotz (David.Kotz@Dartmouth.edu)
- X% Duke University Computer Science Department
- X%
- X% NOTE: If LaTeX runs out of memory processing plots,
- X% add ``with lines 4'' to each curve in eg*.plt and rerun make.
- X%
- X
- X% some header info
- X\input{header}
- X
- X\begin{document}
- X
- X\title{\LaTeX\ and the GNUPLOT Plotting
- XProgram\thanks{This document describes GNUPLOT version 3.0. All plots
- Xin this document were made with that version of GNUPLOT.} }
- X\author{David Kotz \\ \verb+David.Kotz@Dartmouth.edu+}
- X\date{July 3, 1991}
- X
- X\maketitle
- X
- X\pagestyle{myheadings}
- X\markright{GNUPLOT \LaTeX\ Tutorial Version 3.0}
- X
- X\currentspace % defined in header.tex
- X
- X\section{Introduction and History}
- X
- XGNUPLOT was originally developed by Colin Kelley and Thomas Williams
- Xin 1986 to plot functions and data files on a variety of terminals.
- XIn 1988 and 1989 I created an alternate version, known as Gnu\TeX,
- Xthat supported a new ``terminal type'' called {\tt latex}, so gnuplot
- Xwould output \LaTeX\ code. The plot could then be included in a
- X\LaTeX\ document. I added a number of embellishments, supported only
- Xby the {\tt latex} terminal, allowing the user to produce
- Xpublication-quality plots.
- X
- XIn late 1989 and early 1990 Gnu\TeX\ and a number of other GNUPLOT
- Xvariants were merged together into a new release of GNUPLOT, 2.0. This
- Xincludes, among many other improvements, a \LaTeX\ driver derived from
- Xthe one in Gnu\TeX. Former Gnu\TeX\ users are referred to
- XSection~\ref{oldusers} for information about adapting to GNUPLOT.
- XAnyone interested in using GNUPLOT with \LaTeX\ should read the next
- Xsection, a tutorial, and the primary GNUPLOT manual.
- X
- XThe reader should note that the \LaTeX\ picture environments output by
- XGNUPLOT can be quite large and complicated, and can easily exceed the
- Xmemory capacity of \TeX. If an enlarged version of \TeX\ is available,
- Xit is wise to use it. Otherwise, keep your plots simple and add
- X\verb+\clearpage+ to your document where necessary.
- X
- XThere is also a new EEPIC driver ({\tt eepic}), intended for use with
- Xthe EEPIC macro package for \LaTeX. EEPIC allows for much more
- Xefficient line-drawing, runs through \LaTeX\ faster, and uses less
- Xmemory. See Section~\ref{s:eepic} for more information.
- X
- XThere is a small package of auxiliary files (makefiles and scripts)
- Xthat I find useful for making \LaTeX\ plots with GNUPLOT. This is
- Xavailable for \verb+ftp+ as \verb+pub/gnuplot-latex.shar+ from
- X\verb+cs.duke.edu+. I can mail copies (see the end of this paper for
- Xinformation).
- X
- X\section{Using GNUPLOT for \LaTeX: a Tutorial}
- X
- XGNUPLOT is by nature an interactive program. Users making plots for
- X\LaTeX\ will generally not use GNUPLOT interactively. Whenever hard
- Xcopy is desired from GNUPLOT, the program need not be run on a
- Xgraphics terminal. In this case the output is directed to a file or
- Xpipe, then sent to the appropriate output device. For example, output
- Xfrom the terminal type {\tt unixplot} may be sent to a program
- Xinterpreting the Unix plotting standard. The terminal types {\tt
- Ximagen} and {\tt postscript} may be used for output to printers
- Xunderstanding those languages. (A shell script ({\tt lasergnu}) is
- Xsupplied with the distribution that will accept a GNUPLOT command or
- Xinput file and send the output to an Imagen or Postscript laser
- Xprinter. This script may have been adapted to your site.) The terminal
- Xtype {\tt fig} outputs FIG code that can be read by the Fig graphics
- Xprogram and translated into forms usable in both \TeX\ and
- X\LaTeX\ documents.
- X
- XWe now ignore the interactive nature of GNUPLOT and provide the input
- Xto GNUPLOT from a file, \ie,
- X\begin{verbatim}
- X gnuplot gnu.input
- X\end{verbatim}
- XIn this example, all of the commands to GNUPLOT are contained in the
- Xfile {\tt gnu.input}. Multiple filenames may be supplied to GNUPLOT
- Xthis way, read in the order they are given. The output (one or more
- Xplots) may be piped to another program or redirected to a file.
- XUsually, however, we direct the output explicitly with an instruction
- Xto GNUPLOT (the {\tt set output} command). GNUPLOT continues to print
- Xerror messages to the terminal (stderr).
- X
- X\paragraph{Example 1:} Here is a first example, producing a plot for
- Xthis document. The GNUPLOT input file is given below, and the output
- Xappears as Figure~\ref{eg1}. The input file defines the output to be
- Xin \LaTeX, gives a file name for the output, and plots $y=sin(x)$ for
- X$x$ on $[-\pi,\pi]$. To produce the figure, I simply
- X\verb+\input{eg1}+ in a {\tt center} environment in a {\tt figure}
- Xenvironment. In following examples, I will enclose the figure in a box
- Xto make it look a little better.
- X
- X\singlespace
- X\begin{verbatim}
- X set terminal latex
- X set output "eg1.tex"
- X plot [-3.14:3.14] sin(x)
- X\end{verbatim}
- X\currentspace
- X
- X\begin{figure}[htbp]
- X \begin{center}
- X \input{eg1}
- X \end{center}
- X \caption{A first example: $y=sin(x)$}
- X \label{eg1}
- X\end{figure}
- X
- XNote that GNUPLOT has drawn in the axes, labeled the tic marks for us,
- Xscaled the $y$ axis automatically, and added a key in the
- Xupper-right-hand corner (this may be moved with the {\tt set key}
- Xcommand, and removed with {\tt set nokey}).
- X
- XThis is the default line style for the \LaTeX\ driver. Because of the
- Xlimited picture capabilities of \LaTeX, many dots are required to
- Xapproximate drawing a solid line. This may overload the memory of many
- X\TeX\ implementations. There are other line types available that draw
- Xdotted lines and use much less memory. The EEPIC driver draws solid
- Xlines with much less memory usage.
- X
- X\paragraph{Example 2:} Now we will embellish the plot a little with
- Xsome labels. This input file produces Figure~\ref{eg2}.
- X
- X\singlespace
- X\begin{verbatim}
- X set terminal latex
- X set output "eg2.tex"
- X set size 5/5., 4/3.
- X set format xy "$%g$"
- X set title "This is a plot of $y=sin(x)$"
- X set xlabel "This is the $x$ axis"
- X set ylabel "This is\\the\\$y$ axis"
- X plot [0:6.28] [0:1] sin(x)
- X\end{verbatim}
- X\currentspace
- X
- X\boxfigure{htbp}{\fullboxwidth}{
- X \begin{center}
- X \input{eg2}
- X \end{center}
- X \caption{A more fancy example.}
- X \label{eg2}
- X}
- X
- XWe have specified the plot to be 5 inches wide and 4 inches tall with
- Xthe {\tt set size} command. This is the size of the area used by the
- Xplot, {\em including} space for the labels. In the first example,
- Xthis size was the default 5 inches by 3 inches. By specifying the
- Xscaling factors of 1 (or 5/5) and 1.3333 (or 4/3), we obtain the
- Xdesired plot size.
- X
- XWe have requested that the format used by the $x$- and $y$-axis tic
- Xmark labels be in \LaTeX\ math mode. This makes the labels look a
- Xlittle better. The default is \verb+set format xy "%g"+. The \verb+%g+
- Xrepresents the general-purpose floating point formatting specification
- Xfor the {\tt printf} function in C. Any valid floating-point
- Xformatting specification, or \LaTeX\ command, is allowed in the
- Xformat.
- X
- XA title for the plot and labels for the axes were set up in the next
- Xthree commands. Note that they are processed by \LaTeX\ and so may
- Xhave math mode and other symbols in them. The ylabel may have multiple
- Xlines, delineated with \verb+\\+. The ylabel can be moved around with
- Xoptional offset parameters (see {\tt set ylabel} in the GNUPLOT
- Xmanual). Typically, the ylabel needs to be moved to the left to avoid
- Xinterfering with the left-hand side of the plot. Once these labels
- Xare set up, they will be used for all subsequent plot commands until
- Xthey are changed. These labels are also supported by the other
- Xterminal types, but (of course) any \LaTeX\ code in the string will
- Xnot be interpreted. We have also defined the range of both $x$ (now
- X$[0,2\pi]$) and $y$ (here $[0,1]$).
- X
- XSo far we have plotted one curve, $y=\sin(x)$, on one plot. In
- XGNUPLOT, each {\tt plot} command generates a new plot. If the output
- Xis to a screen, the screen is cleared. If to a printer, a new page is
- Xproduced. In the {\tt latex} case, a new picture is started. It is not
- Xlikely that \LaTeX\ users will want this to happen, so generally each
- Xplot has its own input file and is kept in a separate output ({\tt
- X.tex}) file for inclusion at different places in the document.
- X
- X\paragraph{Example 3:} To place more than one curve on a plot, use one
- X{\tt plot} statement and separate the description of each curve by a
- Xcomma. In our next example, we will plot both a function and a data
- Xfile on the same plot. This plot is shown in Figure~\ref{eg3}.
- X
- X\singlespace
- X\begin{verbatim}
- X set terminal latex
- X set output "eg3.tex"
- X set format xy "$%g$"
- X set title "This is another plot"
- X set xlabel "$x$ axis"
- X set ylabel "$y$ axis"
- X set key 15,-10
- X plot x with lines, "eg3.dat" with linespoints
- X\end{verbatim}
- X\currentspace
- X
- X\boxfigure{htbp}{\fullboxwidth}{
- X \begin{center}
- X \input{eg3}
- X \end{center}
- X \caption{An example with two curves on the same plot.}
- X \label{eg3}
- X}
- X
- XHere you will see that the $x$ range was not specified. The $x$ range
- Xis determined automatically, unless specified by the user. In
- Xthis case, it is defined by the range of the data file
- X\verb+"eg3.dat"+. The function is plotted over the same range. If no
- Xdata files or $x$ range are supplied, the default range of $[-10:10]$
- Xis used. We have also moved the key to a different position. The
- Xfunction $y=x$ is plotted ``with lines'', which is the default plot
- Xstyle for functions, and is shown here to illustrate the plot style
- Xoption. The data file {\tt eg3.dat} is plotted with style {\tt
- Xlinespoints}, a style like {\tt lines} that also plots a symbol at
- Xeach data point.
- X
- XThere is a style called {\tt points} that only plots the symbols at
- Xdata points, and another called {\tt dots} that plots a tiny dot for
- Xeach data point. The {\tt points} and {\tt linespoints} styles
- Xproduce a different point symbol for each curve on the plot (for up to
- Xtwelve symbols, after which they are re-used; see
- XFigure~\ref{linepoint} for a complete list). The {\tt lines} and {\tt
- Xlinespoints} styles use a different line style for each curve on the
- Xplot (in this example the dots have different spacing). The
- Xstyle {\tt impulses} draws a perpendicular from each point to the
- X$x$-axis. Finally, the {\tt errorbars} style can draw error bars at
- Xeach data point (see the GNUPLOT manual).
- X
- X\paragraph{Example 4:} In the above plots of $\sin(x)$, it would make
- Xmore sense to label the axis in units of $\pi$. The position and
- Xlabels of the tic labels may be specified by the user, with the {\tt
- Xset xtics} and {\tt set ytics} commands. This is demonstrated by
- Xthe following example, shown in Figure~\ref{eg4}.
- X
- X\singlespace
- X\begin{verbatim}
- X set terminal latex
- X set output "eg4.tex"
- X set format y "$%g$"
- X set format x "$%.2f$"
- X set title "This is $\sin(x)$"
- X set xlabel "This is the $x$ axis"
- X set ylabel "$\sin(x)$"
- X set nokey
- X set xtics -pi, pi/4
- X plot [-pi:pi] [-1:1] sin(x)
- X\end{verbatim}
- X\currentspace
- X
- X\boxfigure{htbp}{\fullboxwidth}{
- X \begin{center}
- X \input{eg4}
- X \end{center}
- X \caption{An example of the {\tt set xtics} command.}
- X \label{eg4}
- X}
- X
- XSince {\tt pi} is a predefined variable in GNUPLOT, we can use it
- Xanywhere we may use an expression. The {\tt set xtics} command here
- Xspecifies that the tics on the $x$ axis start at $-\pi$ and increment
- Xby $\pi/4$. Since no end point is given, the tics continue to the
- Xright edge. We have also turned off the key, and changed the format to
- Xrestrict the $x$-axis tic labels to 2 decimal places.
- X
- XWith a little more work, the plot can look even better. Another form
- Xof this command allows us to specify the label and position of each
- Xtic individually. Replacing the above {\tt set xtics} command with
- Xthe following gives us Figure~\ref{eg5}. We also make use of the line
- Xcontinuation character, the backslash (\verb+\+), to spread out this
- Xcommand for readability.
- X
- X\singlespace
- X\begin{verbatim}
- X set xtics ("$-\pi$" -pi,\
- X "$-\frac{\pi}{2}$" -pi/2,\
- X "0" 0,\
- X "$\frac{\pi}{2}$" pi/2,\
- X "$\pi$" pi)
- X\end{verbatim}
- X\currentspace
- X
- X\boxfigure{htbp}{\fullboxwidth}{
- X \begin{center}
- X \input{eg5}
- X \end{center}
- X \caption{A fancy example of the {\tt set xtics} command.}
- X \label{eg5}
- X}
- X
- X\paragraph{Going further:} You should now be able to make a variety of
- Xplots for your \LaTeX\ document. We will present a final example
- Xwithout explanation that showcases some of the capabilities of
- XGNUPLOT. You may find documentation for the various commands in the
- XGNUPLOT manual, though hopefully this example is somewhat
- Xself-explanatory. This is shown in Figure~\ref{eg6}.
- X
- X\singlespace
- X\begin{verbatim}
- X set terminal latex
- X set output "eg6.tex"
- X set size 3.5/5, 3/3.
- X set format y "$%g$"
- X set format x "$%5.1f\mu$"
- X set title "This is a title"
- X set xlabel "This is the $x$ axis"
- X set ylabel "This is\\a longer\\version\\ of\\the $y$\\ axis"
- X set label "Data" at -5,-5 right
- X set arrow from -5,-5 to -3.3,-6.7
- X set key -4,8
- X set xtic -10,5,10
- X plot [-10:10] [-10:10] "eg3.dat" title "Data File" with linespoints 1 7,\
- X 3*exp(-x*x)+1 title "$3e^{-x^{2}}+1$" with lines 4
- X\end{verbatim}
- X\currentspace
- X
- X\boxfigure{htbp}{\fullboxwidth}{
- X \begin{center}
- X \input{eg6}
- X \end{center}
- X \caption{An example of many features.}
- X \label{eg6}
- X}
- X
- X\paragraph{Line and point types:} For reference, we show all of the
- Xline and point types available in Figure~\ref{linepoint}.
- X
- X\boxfigure{htbp}{\fullboxwidth}{
- X \begin{center}
- X \input{linepoin}
- X \end{center}
- X \caption{All of the line and point types in the \LaTeX\ driver.}
- X \label{linepoint}
- X}
- X
- X\subsection{Summary --- Use with \LaTeX}
- XIn summary, to use the \LaTeX\ facilities of GNUPLOT, the first
- Xcommand to GNUPLOT should be
- X\begin{syntax}
- X set terminal latex
- X\end{syntax}
- Xand the output of GNUPLOT should be directed to a file, for example,
- X\begin{verbatim}
- X set output "plot.tex"
- X\end{verbatim}
- XThis may be anything you like but it should have a {\tt .tex} extension,
- Xof course. Then the size of the plot should be given. For example, the
- Xcommand
- X\begin{verbatim}
- X set size 1,2
- X\end{verbatim}
- Xtells GNUPLOT to use a 5 inch wide by 6 inch high box for the plot.
- XThe numbers given are {\em scale factors}, not the actual size. The
- Xdefault is 5 inches by 3 inches. This is the size of the complete
- Xplot, including all labels.
- X
- XWhen finished, the file will contain all of the plots you have
- Xspecified (you probably only want one plot per file). This file can
- Xthen be used in a \LaTeX\ document, \eg,
- X
- X\singlespace
- X\begin{verbatim}
- X \begin {figure}
- X \begin{center}
- X \input{plot}
- X \end{center}
- X \end {figure}
- X\end{verbatim}
- X\currentspace
- XThis puts the plot into a figure.
- X
- XYou will also want to read about the following commands: {\tt set
- Xtitle, set xlabel, set ylabel, set key, set label, set xtics, set
- Xytics}, and {\tt set clip}. These are all described in the regular
- XGNUPLOT manual.
- X
- X\section{Use with EEPIC}
- X\label{s:eepic}
- XEEPIC is a macro package extending the picture environment of \LaTeX.
- XIf you have the EPIC or EEPIC macros, and your {\tt dvi} translator
- Xsupports the {\em tpic\/} \verb+\special+s, then you can save \LaTeX\
- Xmemory. With EEPIC pictures, the {\tt plot.tex} file will be smaller,
- X\LaTeX\ will run much faster (and need much less memory), and the {\tt
- Xdvi} file will be smaller. The quality of the output is about the
- Xsame. If you change the source, you can generate some more interesting
- Xline styles.
- X
- XTo use EEPIC, set GNUPLOT's terminal type to {\tt eepic} instead of
- X{\tt latex}, and use GNUPLOT as before. The line styles will change.
- XInclude the file {\tt plot.tex} in your document as before, along with
- Xthe document style options {\tt [epic,eepic]}.
- X
- X\section{For Former Gnu\TeX\ Users}
- X\label{oldusers}
- X
- XFormer Gnu\TeX\ users may be pleased with many of the new features
- X(many inspired by your suggestions!), but will also find many changes.
- XGNUPLOT will {\em not\/} run all Gnu\TeX\ input files unchanged.
- XSeveral Gnu\TeX\ features were not included in GNUPLOT because they
- Xwere specific to the \LaTeX\ driver. I encourage you to use the newer
- XGNUPLOT. A translator is available that attempts to translate your
- Xold Gnu\TeX\ 1.6 input files into GNUPLOT 3.0 files. You can ftp it
- Xfrom \verb+cs.duke.edu+ as \verb+dist/sources/gnuplot/gnut2p.tar.Z+.
- XThis file also contains directions and a list of changes from Gnu\TeX\
- Xto GNUPLOT.
- X
- X\section{Contact}
- XPlease contact me at \verb+David.Kotz@Dartmouth.edu+ with any comments you may
- Xhave on GNUPLOT's \LaTeX\ driver. For general GNUPLOT questions, send
- Xmail to the GNUPLOT mailing list
- X(\verb+info-gnuplot@dartmouth.edu+).
- X
- X
- X\end{document}
- END_OF_FILE
- if test 16602 -ne `wc -c <'gnuplot/docs/latextut/tutorial.tex'`; then
- echo shar: \"'gnuplot/docs/latextut/tutorial.tex'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/docs/latextut/tutorial.tex'
- fi
- if test -f 'gnuplot/plot.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/plot.h'\"
- else
- echo shar: Extracting \"'gnuplot/plot.h'\" \(15702 characters\)
- sed "s/^X//" >'gnuplot/plot.h' <<'END_OF_FILE'
- X/*
- X * $Id: plot.h%v 3.50 1993/07/09 05:35:24 woo Exp $
- X *
- X */
- X
- X/* GNUPLOT - plot.h */
- X/*
- X * Copyright (C) 1986 - 1993 Thomas Williams, Colin Kelley
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHORS
- X *
- X * Original Software:
- X * Thomas Williams, Colin Kelley.
- X *
- X * Gnuplot 2.0 additions:
- X * Russell Lang, Dave Kotz, John Campbell.
- X *
- X * Gnuplot 3.0 additions:
- X * Gershon Elber and many others.
- X *
- X * There is a mailing list for gnuplot users. Note, however, that the
- X * newsgroup
- X * comp.graphics.gnuplot
- X * is identical to the mailing list (they
- X * both carry the same set of messages). We prefer that you read the
- X * messages through that newsgroup, to subscribing to the mailing list.
- X * (If you can read that newsgroup, and are already on the mailing list,
- X * please send a message info-gnuplot-request@dartmouth.edu, asking to be
- X * removed from the mailing list.)
- X *
- X * The address for mailing to list members is
- X * info-gnuplot@dartmouth.edu
- X * and for mailing administrative requests is
- X * info-gnuplot-request@dartmouth.edu
- X * The mailing list for bug reports is
- X * bug-gnuplot@dartmouth.edu
- X * The list of those interested in beta-test versions is
- X * info-gnuplot-beta@dartmouth.edu
- X */
- X
- X#define PROGRAM "G N U P L O T"
- X#define PROMPT "gnuplot> "
- X#if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5)
- X#define SHELL "NewShell"
- X#else /* AMIGA */
- X#ifdef ATARI
- X#define SHELL "gulam.prg"
- X#else /* ATARI */
- X#ifdef OS2
- X#define SHELL "c:\\cmd.exe"
- X#else /*OS2 */
- X#define SHELL "/bin/sh" /* used if SHELL env variable not set */
- X#endif /*OS2 */
- X#endif /* ATARI */
- X#endif /* AMIGA */
- X
- X#if defined(__unix__) && !defined(unix)
- X#define unix
- X#endif
- X
- X#define SAMPLES 100 /* default number of samples for a plot */
- X#define ISO_SAMPLES 10 /* default number of isolines per splot */
- X#define ZERO 1e-8 /* default for 'zero' set option */
- X
- X#ifndef TERM
- X/* default terminal is "unknown"; but see init_terminal */
- X#define TERM "unknown"
- X#endif
- X
- X#define TRUE 1
- X#define FALSE 0
- X
- X
- X#define Pi 3.141592653589793
- X#define DEG2RAD (Pi / 180.0)
- X
- X
- X#define MIN_CRV_POINTS 100 /* minimum size of points[] in curve_points */
- X#define MIN_SRF_POINTS 1000 /* minimum size of points[] in surface_points */
- X
- X#define MAX_LINE_LEN 1024 /* maximum number of chars allowed on line */
- X#define MAX_TOKENS 400
- X#define MAX_ID_LEN 50 /* max length of an identifier */
- X
- X
- X#define MAX_AT_LEN 150 /* max number of entries in action table */
- X#define STACK_DEPTH 100
- X#define NO_CARET (-1)
- X
- X#ifdef MSDOS
- X#define MAX_NUM_VAR 3 /* Ploting projection of func. of max. five vars. */
- X#else
- X#define MAX_NUM_VAR 5 /* Ploting projection of func. of max. five vars. */
- X#endif
- X
- X#define MAP3D_CARTESIAN 0 /* 3D Data mapping. */
- X#define MAP3D_SPHERICAL 1
- X#define MAP3D_CYLINDRICAL 2
- X
- X#define CONTOUR_NONE 0 /* Where to place contour maps if at all. */
- X#define CONTOUR_BASE 1
- X#define CONTOUR_SRF 2
- X#define CONTOUR_BOTH 3
- X
- X#define CONTOUR_KIND_LINEAR 0 /* See contour.h in contours subdirectory. */
- X#define CONTOUR_KIND_CUBIC_SPL 1
- X#define CONTOUR_KIND_BSPLINE 2
- X
- X#define LEVELS_AUTO 0 /* How contour levels are set */
- X#define LEVELS_INCREMENTAL 1 /* user specified start & incremnet */
- X#define LEVELS_DISCRETE 2 /* user specified discrete levels */
- X#define MAX_DISCRETE_LEVELS 30
- X
- X#define ANGLES_RADIANS 0
- X#define ANGLES_DEGREES 1
- X
- X
- X#if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5)
- X#define OS "Amiga "
- X#endif
- X
- X#ifdef OS2
- X#ifdef unix
- X#undef unix /* GCC might declare this */
- X#define OS "OS/2"
- X#endif
- X#endif /* OS2 */
- X
- X#ifdef vms
- X#define OS "VMS "
- X#endif
- X
- X#ifdef linux
- X#define OS "Linux "
- X#else
- X#ifdef unix
- X#define OS "unix "
- X#endif
- X#endif
- X
- X#ifdef _WINDOWS
- X#define _Windows
- X#endif
- X
- X#ifdef DOS386
- X#define OS "DOS 386 "
- X#endif
- X#ifdef _Windows
- X#define OS "MS-Windows "
- X#else
- X#ifdef MSDOS
- X#ifdef unix /* __EMX__ and DJGPP may set this */
- X#undef OS
- X#undef unix
- X#endif
- X#define OS "MS-DOS "
- X#endif
- X#endif
- X
- X
- X#ifdef ATARI
- X#define OS "TOS "
- X#endif
- X
- X#ifndef OS
- X#define OS ""
- X#endif
- X
- X
- X/* To access curves larger than 64k, MSDOS needs to use huge pointers */
- X#if (defined(__TURBOC__) && defined(MSDOS)) || (defined(_Windows) && !defined(WIN32))
- X#define GPHUGE huge
- X#define GPFAR far
- X#else
- X#define GPHUGE
- X#define GPFAR
- X#endif
- X
- X
- X/*
- X * Note about VERYLARGE: This is the upper bound double (or float, if PC)
- X * numbers. This flag indicates very large numbers. It doesn't have to
- X * be the absolutely biggest number on the machine.
- X * If your machine doesn't have HUGE, or float.h,
- X * define VERYLARGE here.
- X *
- X * This is a mess. If someone figures out how to clean this up, please
- X * diff -c of your fixes
- X *
- X *
- X * example:
- X#define VERYLARGE 1e37
- X */
- X
- X#ifdef ATARI
- X#include <stdlib.h> /* Prototyping used !! 'size_t' */
- X#include <stdio.h>
- X#include <string.h>
- X#include <math.h>
- X#define VERYLARGE HUGE_VAL
- X#else /* not ATARI */
- X#if defined(MSDOS) || defined(_Windows)
- X#include <float.h>
- X#define VERYLARGE (FLT_MAX/2 -1)
- X#else /* not MSDOS || _Windows */
- X#if defined( vms ) || defined( _CRAY ) || defined( NEXT ) || defined(__osf__) || defined( OS2 ) || defined(__EMX__) || defined( DOS386) || defined(KSR)
- X#include <float.h>
- X#if defined ( NEXT ) /* bug in NeXT OS 2.0 */
- X#if defined ( DBL_MAX)
- X#undef DBL_MAX
- X#endif
- X#define DBL_MAX 1.7976931348623157e+308
- X#undef HUGE
- X#define HUGE DBL_MAX
- X#undef HUGE_VAL
- X#define HUGE_VAL DBL_MAX
- X#endif /* not NEXT but CRAY, VMS or OSF */
- X#define VERYLARGE (DBL_MAX/2 -1)
- X#else /* not vms, CRAY, NEXT, OS/2 or OSF */
- X#ifdef AMIGA_AC_5
- X#include <math.h>
- X#define VERYLARGE (HUGE/2 -1)
- X#else /* not AMIGA_AC_5 */
- X#ifdef AMIGA_SC_6_1
- X#include <float.h>
- X#ifndef HUGE
- X#define HUGE DBL_MAX
- X#endif
- X#define VERYLARGE (HUGE/2 -1)
- X#else /* !AMIGA_SC_6_1 */
- X/* #include <float.h> */
- X#ifdef ISC22
- X#include <float.h>
- X#ifndef HUGE
- X#define HUGE DBL_MAX
- X#endif
- X#endif /* ISC22 */
- X/* This is the default */
- X#ifndef HUGE
- X#define HUGE DBL_MAX
- X#endif
- X#define VERYLARGE (HUGE/2 -1)
- X/* default */
- X#endif /* !AMIGA_SC_6_1 */
- X#endif /* !AMIGA_AC_5 */
- X#endif /* !VMS !CRAY !NEXT */
- X#endif /* !MSDOS || !_Windows */
- X#endif /* !ATARI */
- X
- X#ifdef AMIGA_SC_6_1
- X/* Get function prototypes */
- X#include <stdio.h>
- X#include <stdlib.h>
- X#include <string.h>
- X#include <math.h>
- X#endif /* AMIGA_SC_6_1 */
- X
- X#define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))
- X
- X#ifdef vms
- X
- X
- X#define is_comment(c) ((c) == '#' || (c) == '!')
- X#define is_system(c) ((c) == '$')
- X
- X
- X#else /* vms */
- X
- X#define is_comment(c) ((c) == '#')
- X#define is_system(c) ((c) == '!')
- X
- X#endif /* vms */
- X
- X/* If you don't have vfork, then undefine this */
- X#if defined(NOVFORK) || defined(MSDOS) || defined( OS2 ) || defined(_Windows) || defined(DOS386)
- X# undef VFORK
- X#else
- X# ifdef unix
- X# define VFORK
- X# endif
- X#endif
- X
- X/*
- X * memcpy() comes by many names. The default is now to assume bcopy,
- X * since it is the most common case. Define
- X * MEMCPY to use memcpy(),
- X * vms to use the vms function,
- X * NOCOPY to use a handwritten version in parse.c
- X */
- X#ifdef vms
- X# define memcpy(dest,src,len) lib$movc3(&len,src,dest)
- X#else
- X# if defined(MEMCPY) || defined(MSDOS) || defined (ATARI) || defined( OS2 ) || defined(_Windows) || defined(DOS386)
- X /* use memcpy directly */
- X# else
- X# ifdef NOCOPY
- X /* use the handwritten memcpy in parse.c */
- X# else
- X /* assume bcopy is in use */
- X# define memcpy(dest,src,len) bcopy(src,dest,len)
- X# endif /* NOCOPY */
- X# endif /* MEMCPY || MSDOS */
- X#endif /* vms */
- X
- X/*
- X * In case you have MEMSET instead of BZERO. If you have something
- X * else, define bzero to that something.
- X */
- X#if defined(MEMSET) || defined(MSDOS) || defined( OS2 ) || defined(_Windows) || defined(DOS386)
- X#define bzero(dest,len) (void)(memset(dest, 0, len))
- X#endif /* MEMSET || MSDOS */
- X
- X#define top_of_stack stack[s_p]
- X
- Xtypedef int TBOOLEAN;
- X
- X#ifdef __ZTC__
- Xtypedef int (*FUNC_PTR)(...);
- X#else
- Xtypedef int (*FUNC_PTR)();
- X#endif
- X
- Xenum operators {
- X PUSH, PUSHC, PUSHD1, PUSHD2, PUSHD, CALL, CALLN, LNOT, BNOT, UMINUS,
- X LOR, LAND, BOR, XOR, BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT,
- X DIV, MOD, POWER, FACTORIAL, BOOLE, JUMP, JUMPZ, JUMPNZ, JTERN, SF_START
- X};
- X
- X
- X#define is_jump(operator) ((operator) >=(int)JUMP && (operator) <(int)SF_START)
- X
- X
- Xenum DATA_TYPES {
- X INTGR, CMPLX
- X};
- X
- X
- Xenum PLOT_TYPE {
- X FUNC, DATA, FUNC3D, DATA3D
- X};
- X
- X/*XXX - JG */
- Xenum PLOT_STYLE {
- X LINES, POINTSTYLE, IMPULSES, LINESPOINTS, DOTS, ERRORBARS, BOXES, BOXERROR, STEPS
- X};
- X
- Xenum JUSTIFY {
- X LEFT, CENTRE, RIGHT
- X};
- X
- X#if !(defined(ATARI)&&defined(__GNUC__)&&defined(_MATH_H)) /* FF's math.h has the type already */
- Xstruct cmplx {
- X double real, imag;
- X};
- X#endif
- X
- X
- Xstruct value {
- X enum DATA_TYPES type;
- X union {
- X int int_val;
- X struct cmplx cmplx_val;
- X } v;
- X};
- X
- X
- Xstruct lexical_unit { /* produced by scanner */
- X TBOOLEAN is_token; /* true if token, false if a value */
- X struct value l_val;
- X int start_index; /* index of first char in token */
- X int length; /* length of token in chars */
- X};
- X
- X
- Xstruct ft_entry { /* standard/internal function table entry */
- X char *f_name; /* pointer to name of this function */
- X FUNC_PTR func; /* address of function to call */
- X};
- X
- X
- Xstruct udft_entry { /* user-defined function table entry */
- X struct udft_entry *next_udf; /* pointer to next udf in linked list */
- X char udf_name[MAX_ID_LEN+1]; /* name of this function entry */
- X struct at_type *at; /* pointer to action table to execute */
- X char *definition; /* definition of function as typed */
- X struct value dummy_values[MAX_NUM_VAR]; /* current value of dummy variables */
- X};
- X
- X
- Xstruct udvt_entry { /* user-defined value table entry */
- X struct udvt_entry *next_udv; /* pointer to next value in linked list */
- X char udv_name[MAX_ID_LEN+1]; /* name of this value entry */
- X TBOOLEAN udv_undef; /* true if not defined yet */
- X struct value udv_value; /* value it has */
- X};
- X
- X
- Xunion argument { /* p-code argument */
- X int j_arg; /* offset for jump */
- X struct value v_arg; /* constant value */
- X struct udvt_entry *udv_arg; /* pointer to dummy variable */
- X struct udft_entry *udf_arg; /* pointer to udf to execute */
- X};
- X
- X
- Xstruct at_entry { /* action table entry */
- X enum operators index; /* index of p-code function */
- X union argument arg;
- X};
- X
- X
- Xstruct at_type {
- X int a_count; /* count of entries in .actions[] */
- X struct at_entry actions[MAX_AT_LEN];
- X /* will usually be less than MAX_AT_LEN is malloc()'d copy */
- X};
- X
- X
- X/* Defines the type of a coordinate */
- X/* INRANGE and OUTRANGE points have an x,y point associated with them */
- Xenum coord_type {
- X INRANGE, /* inside plot boundary */
- X OUTRANGE, /* outside plot boundary, but defined */
- X UNDEFINED /* not defined at all */
- X};
- X
- X#if defined(MSDOS) || defined(_Windows)
- Xtypedef float coordval; /* memory is tight on PCs! */
- X#else
- Xtypedef double coordval;
- X#endif
- X
- Xstruct coordinate {
- X enum coord_type type; /* see above */
- X coordval x, y, z;
- X coordval ylow, yhigh; /* ignored in 3d */
- X#if (defined(_Windows) && !defined(WIN32)) || (defined(MSDOS) && defined(__TURBOC__))
- X char pad[10]; /* pad to 32 byte boundary */
- X#endif
- X};
- X
- Xstruct curve_points {
- X struct curve_points *next_cp; /* pointer to next plot in linked list */
- X enum PLOT_TYPE plot_type;
- X enum PLOT_STYLE plot_style;
- X char *title;
- X int line_type;
- X int point_type;
- X int p_max; /* how many points are allocated */
- X int p_count; /* count of points in points */
- X struct coordinate GPHUGE *points;
- X};
- X
- Xstruct gnuplot_contours {
- X struct gnuplot_contours *next;
- X struct coordinate GPHUGE *coords;
- X char isNewLevel;
- X char label[12];
- X int num_pts;
- X};
- X
- Xstruct iso_curve {
- X struct iso_curve *next;
- X int p_max; /* how many points are allocated */
- X int p_count; /* count of points in points */
- X struct coordinate GPHUGE *points;
- X};
- X
- Xstruct surface_points {
- X struct surface_points *next_sp; /* pointer to next plot in linked list */
- X enum PLOT_TYPE plot_type;
- X enum PLOT_STYLE plot_style;
- X char *title;
- X int line_type;
- X int point_type;
- X int has_grid_topology;
- X int num_iso_read; /* Data files only - num of isolines read from file. */
- X struct gnuplot_contours *contours; /* Not NULL If have contours. */
- X struct iso_curve *iso_crvs;
- X};
- X
- Xstruct TERMENTRY {
- X char *name;
- X#if defined(_Windows) && !defined(WIN32)
- X char GPFAR description[80]; /* to make text go in FAR segment */
- X#else
- X char *description;
- X#endif
- X unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
- X FUNC_PTR options,init,reset,text,scale,graphics,move,vector,linetype,
- X put_text,text_angle,justify_text,point,arrow;
- X};
- X
- X#ifdef _Windows
- X#define termentry TERMENTRY far
- X#else
- X#define termentry TERMENTRY
- X#endif
- X
- X
- Xstruct text_label {
- X struct text_label *next; /* pointer to next label in linked list */
- X int tag; /* identifies the label */
- X double x,y,z;
- X enum JUSTIFY pos;
- X char text[MAX_LINE_LEN+1];
- X};
- X
- Xstruct arrow_def {
- X struct arrow_def *next; /* pointer to next arrow in linked list */
- X int tag; /* identifies the arrow */
- X double sx,sy,sz; /* start position */
- X double ex,ey,ez; /* end position */
- X TBOOLEAN head; /* arrow has a head or not */
- X};
- X
- X/* Tic-mark labelling definition; see set xtics */
- Xstruct ticdef {
- X int type; /* one of three values below */
- X#define TIC_COMPUTED 1 /* default; gnuplot figures them */
- X#define TIC_SERIES 2 /* user-defined series */
- X#define TIC_USER 3 /* user-defined points */
- X#define TIC_MONTH 4 /* print out month names ((mo-1)%12)+1 */
- X#define TIC_DAY 5 /* print out day of week */
- X union {
- X struct { /* for TIC_SERIES */
- X double start, incr;
- X double end; /* ymax, if VERYLARGE */
- X } series;
- X struct ticmark *user; /* for TIC_USER */
- X } def;
- X};
- X
- X/* Defines one ticmark for TIC_USER style.
- X * If label==NULL, the value is printed with the usual format string.
- X * else, it is used as the format string (note that it may be a constant
- X * string, like "high" or "low").
- X */
- Xstruct ticmark {
- X double position; /* where on axis is this */
- X char *label; /* optional (format) string label */
- X struct ticmark *next; /* linked list */
- X};
- X
- X/*
- X * SS$_NORMAL is "normal completion", STS$M_INHIB_MSG supresses
- X
- X * printing a status message.
- X * SS$_ABORT is the general abort status code.
- X from: Martin Minow
- X decvax!minow
- X */
- X#ifdef vms
- X#include <ssdef.h>
- X#include <stsdef.h>
- X#define IO_SUCCESS (SS$_NORMAL | STS$M_INHIB_MSG)
- X#define IO_ERROR SS$_ABORT
- X#endif /* vms */
- X
- X
- X#ifndef IO_SUCCESS /* DECUS or VMS C will have defined these already */
- X#define IO_SUCCESS 0
- X#endif
- X#ifndef IO_ERROR
- X#define IO_ERROR 1
- X#endif
- X
- X/* Some key global variables */
- Xextern TBOOLEAN screen_ok;
- Xextern TBOOLEAN term_init;
- Xextern TBOOLEAN undefined;
- Xextern struct termentry term_tbl[];
- X
- Xextern char *alloc();
- Xextern char GPFAR *gpfaralloc(); /* far versions */
- Xextern char GPFAR *gpfarrealloc();
- Xextern void gpfarfree();
- X/* allocating and managing curve_points structures */
- Xextern struct curve_points *cp_alloc();
- Xextern int cp_extend();
- Xextern int cp_free();
- X/* allocating and managing surface_points structures */
- Xextern struct surface_points *sp_alloc();
- Xextern int sp_replace();
- Xextern int sp_free();
- X/* allocating and managing is_curve structures */
- Xextern struct iso_curve *iso_alloc();
- Xextern int iso_extend();
- Xextern int iso_free();
- X
- X/* Windows needs to redefine stdin/stdout functions */
- X#ifdef _Windows
- X#include "win/wtext.h"
- X#endif
- END_OF_FILE
- if test 15702 -ne `wc -c <'gnuplot/plot.h'`; then
- echo shar: \"'gnuplot/plot.h'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/plot.h'
- fi
- if test -f 'gnuplot/term/hp26.trm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/term/hp26.trm'\"
- else
- echo shar: Extracting \"'gnuplot/term/hp26.trm'\" \(16288 characters\)
- sed "s/^X//" >'gnuplot/term/hp26.trm' <<'END_OF_FILE'
- X/*
- X * $Id: hp26.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
- X */
- X
- X/* GNUPLOT - HP26.trm */
- X/*
- X * Copyright (C) 1990
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X * This file is included by ../term.c.
- X *
- X * This terminal driver supports:
- X * HP2623A
- X *
- X * AUTHORS
- X * luecken@udel.edu (Bruce Lueckenhoff)
- X * hplvlch!ch (Chuck Heller)
- X *
- X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
- X *
- X */
- X
- X
- X#define HP26_XMAX 512
- X#define HP26_YMAX 390
- X
- X#define HP26_XLAST (HP26_XMAX - 1)
- X#define HP26_YLAST (HP26_XMAX - 1)
- X
- X/* Use a size 1 character, or a 7 x 10 grid. */
- X#define HP26_VCHAR 10
- X#define HP26_HCHAR 7
- X#define HP26_VTIC 5
- X#define HP26_HTIC 5
- X
- X/* include the stream compaction routines */
- X#include "compact.c"
- X
- Xtypedef struct _HP26_Buffer_Node{
- X int index;
- X int size;
- X int next;
- X int linetype;
- X int *x;
- X int *y;
- X TBOOLEAN *isa_move;
- X} HP26_Buffer_Node;
- X
- X/* constructor method */
- XHP26_Buffer_Node *BN_create(index, size, linetype)
- Xint index, size, linetype;
- X{
- X HP26_Buffer_Node *the_node;
- X the_node = (HP26_Buffer_Node *) malloc(sizeof(HP26_Buffer_Node));
- X the_node->index = index;
- X the_node->linetype = linetype;
- X the_node->size = size;
- X the_node->next = 0;
- X the_node->x = (int *) calloc(the_node->size, sizeof(int));
- X the_node->y = (int *) calloc(the_node->size, sizeof(int));
- X the_node->isa_move = (TBOOLEAN *)calloc(the_node->size,sizeof(TBOOLEAN));
- X if (the_node->x == NULL
- X ||the_node->y == NULL
- X ||the_node->isa_move == NULL)
- X return (NULL);
- X else
- X return(the_node);
- X}
- X
- X/* destructor method */
- Xvoid BN_delete(the_node)
- XHP26_Buffer_Node *the_node;
- X{
- X free(the_node->x);
- X free(the_node->y);
- X free(the_node->isa_move);
- X free(the_node);
- X}
- X
- X/* 2 for border and axes + 9 for plots + 1 for dots */
- X#define HP26_gnu_map_size 12
- XHP26_Buffer_Node *HP26_gnu_map[HP26_gnu_map_size];
- XHP26_Buffer_Node *HP26_buff;
- Xint HP26_pen_x;
- Xint HP26_pen_y;
- Xint HP26_angle;
- Xint HP26_cursor_x;
- Xint HP26_cursor_y;
- XTBOOLEAN HP26_in_text;
- Xint HP26_linetype_current;
- Xint HP26_reduction_int;
- Xint HP26_reduction_slope;
- Xint HP26_overflows;
- Xint HP26_nop_move;
- Xint HP26_nop_vect;
- Xint HP26_nop_line;
- X
- X/* linetype stuff */
- X#define SOLID 1
- X#define USER 2
- X#define LINE3 3
- X#define LINE4 4
- X#define LINE5 5
- X#define LINE6 6
- X#define DOTS 7
- X#define LINE8 8
- X#define LINE9 9
- X#define LINE10 10
- X#define POINT 11
- X
- X
- X
- X#define swap(a, b) a ^= b; b ^= a; a ^= b;
- X
- Xchar HP26_bin_short_table[32]={
- X'0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?',
- X' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/'};
- X/* encodes an integer (assumed to be in range) into
- X binary short incremental format (j)*/
- X#define short_encode(n) (HP26_bin_short_table[n+16])
- X
- X/* tells whether a given delta_x,delta_y pair can be expressed in
- X binary short incremental format */
- X#define qualified(dx,dy) ((dx>-17)&&(dy>-17)&&(dx<16)&&(dy<16))
- X
- X
- Xchar HP26_bin_table[32]={
- X' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/',
- X'0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?'};
- X/* returns the high byte of integer n in binary absolute format (i) */
- X#define bin_encode_hi(n) (HP26_bin_table[n>>5])
- X/* returns the low byte of integer n in binary absolute format (i) */
- X#define bin_encode_lo(n) (HP26_bin_table[n & 31])
- X
- X
- X
- X/* the guts of the program
- X-- first checks if any work need be done and, failing that, returns
- X immediately
- X-- tries to compress the vector stream
- X-- goes through the buffer, using binary short incremental (2 bytes/point)
- X as much as possible, even if must output two pairs to express one vector
- X (it's no more expensive, and will hopefully damp any excessive switching
- X back and forth between the two formats)
- X if can't use binary short incremental, use binary
- X absolute(4 bytes/point)
- X-- finally, resets the HP26_next pointer to zero */
- XHP26_flush(the_buff)
- XHP26_Buffer_Node *the_buff;
- X{
- X int i, delta_x, delta_y, half_dx, half_dy;
- X int *buff_x, *buff_y;
- X TBOOLEAN *isa_move;
- X TBOOLEAN bin_short;
- X
- X if (the_buff->next == 0)
- X return (FALSE);
- X /* init pointers for easy access */
- X buff_x = the_buff->x;
- X buff_y = the_buff->y;
- X isa_move = the_buff->isa_move;
- X if (HP26_in_text){
- X fputs("\033*dT", outfile);
- X HP26_in_text = FALSE;
- X }
- X if (HP26_linetype_current != the_buff->linetype
- X && (the_buff->next > 1 || !isa_move[0])){
- X fprintf(outfile,"\033*m%dB",the_buff->linetype);
- X HP26_linetype_current = the_buff->linetype;
- X }
- X /* try to compress the stream */
- X if (the_buff->next>30 && the_buff->linetype != POINT){
- X/* HP26_reduction_int += compact_int(buff_x,buff_y,isa_move, &(the_buff->next)); */
- X HP26_reduction_slope += compact_slope(buff_x,buff_y,isa_move, &(the_buff->next),0.1);
- X }
- X
- X /* start escape sequence */
- X fputs("\033*p",outfile);
- X /* initialize the state: binary short incremental or binary absolute */
- X delta_x = buff_x[0] - HP26_pen_x;
- X delta_y = buff_y[0] - HP26_pen_y;
- X if (qualified(delta_x, delta_y)){
- X fputc('j', outfile);
- X bin_short = TRUE;
- X }else{
- X fputc('i', outfile);
- X bin_short = FALSE;
- X }
- X /* now work through the list */
- X for (i=0;i<the_buff->next;i++){
- X if (i>0){
- X delta_x = buff_x[i] - buff_x[i-1];
- X delta_y = buff_y[i] - buff_y[i-1];
- X }
- X if ((delta_x==0)&&(delta_y==0)){
- X if (i>0 && !isa_move[i-1] && !isa_move[i]){
- X /* allow null vectors only when drawing dots */
- X HP26_nop_vect++;
- X continue;
- X }else if (isa_move[i]){
- X /* a null move */
- X HP26_nop_move++;
- X continue;
- X }
- X }else if (i > 0
- X && i+1 <the_buff->next
- X && isa_move[i]
- X && isa_move[i+1]){
- X /* consecutive moves are condensed into one */
- X HP26_nop_move++;
- X continue;
- X }else if (!qualified(delta_x, delta_y)
- X && i > 0
- X && i + 2 < the_buff->next
- X && isa_move[i]
- X && !isa_move[i+1]
- X && isa_move[i+2]
- X &&qualified(buff_x[i+1]-buff_x[i-1],buff_y[i+1]-buff_y[i-1])){
- X swap(buff_x[i], buff_x[i+1]);
- X swap(buff_y[i], buff_y[i+1]);
- X /* set up new delta_x & delta_y */
- X delta_x = buff_x[i] - buff_x[i-1];
- X delta_y = buff_y[i] - buff_y[i-1];
- X }
- X if (qualified(delta_x,delta_y)){
- X if (!bin_short){
- X fputc ('j',outfile);
- X bin_short = TRUE;
- X }
- X if (isa_move[i])
- X fputc ('a',outfile);
- X fputc(short_encode(delta_x), outfile);
- X fputc(short_encode(delta_y), outfile);
- X }else{
- X half_dx = (delta_x + (delta_x>0 ? 1 : -1))/2;
- X half_dy = (delta_y + (delta_y>0 ? 1 : -1))/2;
- X if (bin_short && qualified(half_dx,half_dy)){
- X if (isa_move[i])
- X fputc('a',outfile);
- X fputc(short_encode(half_dx), outfile);
- X fputc(short_encode(half_dy), outfile);
- X if (isa_move[i])
- X fputc('a',outfile);
- X fputc(short_encode(delta_x - half_dx), outfile);
- X fputc(short_encode(delta_y - half_dy), outfile);
- X }else{
- X if (bin_short){
- X bin_short = FALSE;
- X fputc('i',outfile);
- X }
- X if (isa_move[i])
- X fputc('a',outfile);
- X fputc(bin_encode_hi(buff_x[i]), outfile);
- X fputc(bin_encode_lo(buff_x[i]), outfile);
- X fputc(bin_encode_hi(buff_y[i]), outfile);
- X fputc(bin_encode_lo(buff_y[i]), outfile);
- X }
- X }
- X } /* end for.. */
- X /* the term doesn't seem to mind leaving this out */
- X /* finish the escape sequence */
- X fputc ('Z',outfile);
- X /* set these for next time */
- X HP26_pen_x = buff_x[the_buff->next - 1];
- X HP26_pen_y = buff_y[the_buff->next - 1];
- X the_buff->next = 0;
- X return(TRUE);
- X}
- X
- XHP26_handle_overflow()
- X{
- X HP26_Buffer_Node *bigger, *old;
- X int x, y;
- X x = (HP26_buff->x)[HP26_buff->next - 1];
- X y = (HP26_buff->y)[HP26_buff->next - 1];
- X HP26_flush(HP26_buff);
- X bigger = BN_create(HP26_buff->index, HP26_buff->size * 2,
- X HP26_buff->linetype);
- X if (bigger != NULL){
- X old = HP26_buff;
- X HP26_gnu_map[bigger->index] = bigger;
- X /* special case since DOTS entry is shared 3 ways */
- X if(bigger->index == 0){
- X HP26_gnu_map[1] = bigger;
- X HP26_gnu_map[3] = bigger;
- X }
- X HP26_buff = bigger;
- X BN_delete(old);
- X }
- X (HP26_buff->x)[0] = x;
- X (HP26_buff->y)[0] = y;
- X (HP26_buff->isa_move)[0] = TRUE;
- X HP26_buff->next = 1;
- X HP26_overflows++;
- X}
- X
- X/* checks for NOP, overcapacity condition, and then adds vector to the list */
- XHP26_vector(x,y)
- Xint x,y;
- X{
- X if (HP26_buff->next > 2
- X && x == (HP26_buff->x)[HP26_buff->next-1]
- X && y == (HP26_buff->y)[HP26_buff->next-1]
- X && !(HP26_buff->isa_move)[HP26_buff->next-1] ){
- X HP26_nop_vect++;
- X return(FALSE);
- X }
- X if (HP26_buff->next == HP26_buff->size)
- X HP26_handle_overflow();
- X /* otherwise add to the list */
- X (HP26_buff->x)[HP26_buff->next] = x;
- X (HP26_buff->y)[HP26_buff->next] = y;
- X (HP26_buff->isa_move)[HP26_buff->next] = FALSE;
- X HP26_buff->next++;
- X}
- X
- X/* checks for NOP, checks for overcapacity, puts self on list */
- XHP26_move(x,y)
- Xint x,y;
- X{
- X if (HP26_buff->next > 0){
- X if (((HP26_buff->x)[HP26_buff->next - 1] == x)
- X &&((HP26_buff->y)[HP26_buff->next - 1] == y)){
- X /* null moves are NOP's */
- X HP26_nop_move++;
- X return (FALSE);
- X }else if ((HP26_buff->isa_move)[HP26_buff->next-1]){
- X /* consecutive moves are NOP's */
- X (HP26_buff->x)[HP26_buff->next-1] = x;
- X (HP26_buff->y)[HP26_buff->next-1] = y;
- X HP26_nop_move++;
- X return (TRUE);
- X }
- X }
- X if (HP26_buff->next == HP26_buff->size)
- X HP26_handle_overflow();
- X (HP26_buff->x)[HP26_buff->next] = x;
- X (HP26_buff->y)[HP26_buff->next] = y;
- X (HP26_buff->isa_move)[HP26_buff->next] = TRUE;
- X HP26_buff->next++;
- X return (TRUE);
- X}
- X
- XHP26_init()
- X{
- X HP26_gnu_map[-2 + 2] = BN_create( 0, 2048, DOTS); /* border */
- X HP26_gnu_map[-1 + 2] = HP26_gnu_map[-2 + 2]; /* axes */
- X HP26_gnu_map[ 0 + 2] = BN_create( 2, 3072, SOLID); /* plot 0 */
- X HP26_gnu_map[ 1 + 2] = HP26_gnu_map[-2 + 2]; /* plot 1 */
- X HP26_gnu_map[ 2 + 2] = BN_create( 4, 1024, LINE5); /* plot 2 */
- X HP26_gnu_map[ 3 + 2] = BN_create( 5, 256, LINE6); /* plot 3 */
- X HP26_gnu_map[ 4 + 2] = BN_create( 6, 256, LINE8); /* plot 4 */
- X HP26_gnu_map[ 5 + 2] = BN_create( 7, 128, LINE9); /* plot 5 */
- X HP26_gnu_map[ 6 + 2] = BN_create( 8, 128, LINE10); /* plot 6 */
- X HP26_gnu_map[ 7 + 2] = BN_create( 9, 64, LINE6); /* plot 7 */
- X HP26_gnu_map[ 8 + 2] = BN_create(10, 64, LINE4); /* plot 8 */
- X HP26_gnu_map[ 9 + 2] = BN_create(11, 512, POINT); /* point plot */
- X HP26_buff = HP26_gnu_map[10]; /* set to an unlikely linetype */
- X HP26_linetype_current = 0; /* set to force a linetype change */
- X HP26_angle = 1; /* left to right, default */
- X fputs("\033*mp1m2a2Q",outfile);
- X /* 1 2 3 4
- X 1. make text upright
- X 2. select text size 1
- X 3. make SET the default drawing op
- X 4. left justify text */
- X fflush (outfile);
- X}
- X
- X
- XHP26_graphics()
- X{
- X fputs("\033*daflsC", outfile);
- X /* 12345
- X 1. clear graphics display
- X 2. shut off the alphanumeric display
- X 3. graphics cursor off
- X 4. into graphics text mode
- X 5. enable graphics display */
- X /* set the pen & cursor positions to force an initial absolute move */
- X HP26_pen_x = HP26_pen_y = -200;
- X HP26_cursor_x = HP26_cursor_y = 800;
- X HP26_in_text = TRUE;
- X /* initialize statistics */
- X HP26_reduction_int = 0;
- X HP26_reduction_slope = 0;
- X HP26_nop_move = 0;
- X HP26_nop_vect = 0;
- X HP26_nop_line = 0;
- X HP26_overflows = 0;
- X}
- X
- X
- XHP26_text()
- X{
- X int i, j, curr;
- X
- X /* always flush the current line first */
- X for (i=0;i<HP26_gnu_map_size;i++)
- X if ((HP26_gnu_map[i])->linetype == HP26_linetype_current)
- X HP26_flush(HP26_gnu_map[i]);
- X /* now flush the rest of the lines */
- X for (i=0;i<HP26_gnu_map_size;i++){
- X HP26_flush(HP26_gnu_map[i]);
- X curr = HP26_gnu_map[i] -> linetype;
- X for (j=0;j<HP26_gnu_map_size;j++)
- X if ((HP26_gnu_map[j])->linetype == curr)
- X HP26_flush(HP26_gnu_map[j]);
- X }
- X fputs("\033*deT",outfile);
- X /* 12
- X 1. turn on the alphanumeric display
- X 2. back to text mode */
- X fflush(outfile);
- X /* informational: tells how many points compressed, how
- X many NOP's of each type, and how many times a buffer
- X overflowed during this plot */
- X /*
- X if(HP26_reduction_int
- X + HP26_reduction_slope
- X + HP26_nop_move
- X + HP26_nop_vect
- X + HP26_overflows
- X + HP26_nop_line > 0){
- X if (HP26_reduction_int>0)
- X printf("%d int-compress",HP26_reduction_int);
- X if (HP26_reduction_slope>0)
- X printf("%d slope-compress",HP26_reduction_slope);
- X if (HP26_nop_move>0)
- X printf(" %d nop_move",HP26_nop_move);
- X if (HP26_nop_vect>0)
- X printf(" %d nop_vect",HP26_nop_vect);
- X if (HP26_nop_line>0)
- X printf(" %d nop_line",HP26_nop_line);
- X if (HP26_overflows>0)
- X printf(" %d buffer overflows",HP26_overflows);
- X printf("\n");
- X }
- X */
- X}
- X
- XHP26_reset()
- X{
- X int i;
- X for (i=0;i<HP26_gnu_map_size;i++)
- X BN_delete(HP26_gnu_map[i]);
- X}
- X
- XHP26_text_angle (ang)
- Xint ang;
- X{
- X HP26_angle = ang + 1;
- X fprintf(outfile,"\033*m%dN",HP26_angle);
- X return(TRUE);
- X}
- X
- X
- XHP26_put_text(x, y,str)
- Xint x, y;
- Xchar *str;
- X{
- X char abs_str[10],rel_str[10];
- X
- X if (!strlen(str))
- X return(FALSE);
- X else{
- X fputs("\033*d", outfile);
- X if (!HP26_in_text){
- X fputc('s', outfile);
- X HP26_in_text = TRUE;
- X }
- X sprintf(rel_str,"%d,%dP",x - HP26_cursor_x, y - HP26_cursor_y);
- X sprintf(abs_str,"%d,%dO", x, y);
- X if (strlen(rel_str) < strlen(abs_str))
- X fputs(rel_str, outfile);
- X else
- X fputs(abs_str, outfile);
- X fputs(str, outfile);
- X HP26_pen_x = HP26_cursor_x = x;
- X HP26_pen_y = HP26_cursor_y = y;
- X }
- X /*
- X tmp = &(HP26_all_buffers[HP26_linetype_current]);
- X tmp->x[tmp->next] = x;
- X tmp->y[tmp->next] = y;
- X tmp->isa_move[tmp->next] = TRUE;
- X tmp->next++;
- X HP26_flush(tmp);
- X fprintf(outfile,"\033*l%s\r",str);
- X */
- X return(TRUE);
- X}
- X
- X
- X/* checks for NOP, sets HP26_buff to point to the right buffer */
- XHP26_linetype(linetype)
- Xint linetype;
- X{
- X if (linetype > 8)
- X linetype %= 9;
- X linetype += 2;
- X if (HP26_gnu_map[linetype] == HP26_buff){
- X HP26_nop_line++;
- X return (FALSE); /* gnuplot just sent us another NOP */
- X }
- X HP26_buff = HP26_gnu_map[linetype];
- X return (TRUE);
- X}
- X
- X
- X
- X/* switches to a solid linetype and calls do_point, then switches back */
- XHP26_line_and_point(x,y,number)
- Xint x,y,number;
- X{
- X int line_save,not_solid;
- X
- X not_solid = (HP26_buff->linetype != SOLID);
- X if (not_solid){
- X line_save = HP26_buff->linetype;
- X HP26_linetype (0); /*switch to a solid line*/
- X }
- X HP26_do_point(x, y, number);
- X if (not_solid)
- X HP26_linetype(line_save);
- X return (TRUE);
- X}
- X
- X
- X/* provides 9 point types so they stay in sync with the linetypes
- Xputs simpler point types first on the assumption they are more
- Xfrequently used */
- XHP26_do_point (x, y,number)
- Xint x, y,number;
- X{
- X int htic,vtic;
- X HP26_Buffer_Node *tmp;
- X
- X vtic = HP26_VTIC/2;
- X htic = HP26_HTIC/2;
- X if (number<0){
- X /* do a dot -- special case */
- X tmp = HP26_buff;
- X HP26_buff = HP26_gnu_map[11]; /* point plot */
- X HP26_vector(x, y);
- X HP26_buff = tmp;
- X return(TRUE);
- X }
- X switch (number % 9){
- X case 0:
- X /* do triangle */
- X HP26_move(x-htic, y-vtic);
- X HP26_vector(x, y+vtic);
- X HP26_vector(x+htic, y-vtic);
- X HP26_vector(x-htic, y-vtic);
- X break;
- X case 1:
- X /* do nambla */
- X HP26_move(x-htic, y+vtic);
- X HP26_vector(x, y-vtic);
- X HP26_vector(x+htic, y+vtic);
- X HP26_vector(x-htic, y+vtic);
- X break;
- X case 2:
- X /* do left triangle */
- X HP26_move(x-htic, y);
- X HP26_vector(x+htic, y+vtic);
- X HP26_vector(x+htic, y-vtic);
- X HP26_vector(x-htic, y);
- X break;
- X case 3:
- X /* do right triangle */
- X HP26_move(x+htic, y);
- X HP26_vector(x-htic, y+vtic);
- X HP26_vector(x-htic, y-vtic);
- X HP26_vector(x+htic, y);
- X break;
- X case 4:
- X /* do box */
- X HP26_move(x-htic, y-vtic);
- X HP26_vector(x-htic, y+vtic);
- X HP26_vector(x+htic, y+vtic);
- X HP26_vector(x+htic, y-vtic);
- X HP26_vector(x-htic, y-vtic);
- X break;
- X case 5:
- X /* do plus */
- X HP26_move(x, y+vtic);
- X HP26_vector(x, y-vtic);
- X HP26_move(x-htic, y);
- X HP26_vector(x+htic, y);
- X break;
- X case 6:
- X /* do X */
- X HP26_move(x+htic, y+vtic);
- X HP26_vector(x-htic, y-vtic);
- X HP26_move(x-htic, y+vtic);
- X HP26_vector(x+htic, y-vtic);
- X break;
- X default:
- X /* do diamond */
- X HP26_move(x, y-vtic);
- X HP26_vector(x-htic, y);
- X HP26_vector(x, y+vtic);
- X HP26_vector(x+htic, y);
- X HP26_vector(x, y-vtic);
- X break;
- X }
- X return(TRUE);
- X}
- END_OF_FILE
- if test 16288 -ne `wc -c <'gnuplot/term/hp26.trm'`; then
- echo shar: \"'gnuplot/term/hp26.trm'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/term/hp26.trm'
- fi
- echo shar: End of archive 20 \(of 33\).
- cp /dev/null ark20isdone
- MISSING=""
- for I in 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 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 33 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-