home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-26 | 48.3 KB | 1,470 lines |
- Newsgroups: comp.sources.misc
- From: gershon%gr@cs.utah.edu (Elber Gershon)
- Subject: v24i030: gnuplot3 - interactive function plotting utility, Part08/26
- Message-ID: <1991Oct26.222356.6572@sparky.imd.sterling.com>
- X-Md4-Signature: a62c77c6dc395bc4f18e49a7ee6f3fef
- Date: Sat, 26 Oct 1991 22:23:56 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: gershon%gr@cs.utah.edu (Elber Gershon)
- Posting-number: Volume 24, Issue 30
- Archive-name: gnuplot3/part08
- Environment: UNIX, MS-DOS, VMS
- Supersedes: gnuplot2: Volume 11, Issue 65-79
-
- #!/bin/sh
- # this is Part.08 (part 8 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file gnuplot/docs/doc2hlp.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 8; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping gnuplot/docs/doc2hlp.c'
- else
- echo 'x - continuing file gnuplot/docs/doc2hlp.c'
- sed 's/^X//' << 'SHAR_EOF' >> 'gnuplot/docs/doc2hlp.c' &&
- X (void) fputs(line,b);
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X (void) fputs(line,b);
- X } else
- X fprintf(stderr, "unknown control code '%c' in column 1, line %d\n",
- X line[0], line_count);
- X break;
- X }
- X }
- }
- SHAR_EOF
- echo 'File gnuplot/docs/doc2hlp.c is complete' &&
- chmod 0666 gnuplot/docs/doc2hlp.c ||
- echo 'restore of gnuplot/docs/doc2hlp.c failed'
- Wc_c="`wc -c < 'gnuplot/docs/doc2hlp.c'`"
- test 1471 -eq "$Wc_c" ||
- echo 'gnuplot/docs/doc2hlp.c: original size 1471, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/docs/doc2hlp.com ==============
- if test -f 'gnuplot/docs/doc2hlp.com' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/docs/doc2hlp.com (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/docs/doc2hlp.com (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/doc2hlp.com' &&
- $ def/user sys$input [.docs]gnuplot.doc
- $ def/user sys$output []gnuplot.hlp
- $ run doc2hlp
- SHAR_EOF
- chmod 0666 gnuplot/docs/doc2hlp.com ||
- echo 'restore of gnuplot/docs/doc2hlp.com failed'
- Wc_c="`wc -c < 'gnuplot/docs/doc2hlp.com'`"
- test 90 -eq "$Wc_c" ||
- echo 'gnuplot/docs/doc2hlp.com: original size 90, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/docs/doc2ms.c ==============
- if test -f 'gnuplot/docs/doc2ms.c' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/docs/doc2ms.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/docs/doc2ms.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/doc2ms.c' &&
- /*
- X * doc2ms.c -- program to convert Gnuplot .DOC format to *roff -ms document
- X * From hlp2ms by Thomas Williams
- X *
- X * Modified by Russell Lang, 2nd October 1989
- X * to make vms help level 1 and 2 create the same ms section level.
- X *
- X * Modified to become doc2ms by David Kotz (David.Kotz@Dartmouth.edu) 12/89
- X * Added table and backquote support.
- X *
- X * usage: doc2ms < file.doc > file.ms
- X *
- X * where file.doc is a VMS .DOC file, and file.ms will be a [nt]roff
- X * document suitable for printing with nroff -ms or troff -ms
- X *
- X * typical usage for GNUPLOT:
- X *
- X * doc2ms < gnuplot.doc | troff -ms
- X */
- X
- static char rcsid[] = "$Id: doc2ms.c,v 1.1 90/01/11 15:43:54 dfk Exp Locker: dfk $";
- X
- #include <stdio.h>
- #include <ctype.h>
- #ifdef AMIGA_LC_5_1
- #include <string.h>
- #endif
- X
- #define MAX_NAME_LEN 256
- #define MAX_LINE_LEN 256
- #define LINE_SKIP 3
- X
- #define TRUE 1
- #define FALSE 0
- X
- typedef int boolean;
- X
- static boolean intable = FALSE;
- X
- main()
- {
- X init(stdout);
- X convert(stdin,stdout);
- X finish(stdout);
- X exit(0);
- }
- X
- X
- init(b)
- FILE *b;
- {
- X /* in nroff, increase line length by 8 and don't adjust lines */
- X (void) fputs(".if n \\{.nr LL +8m\n.na \\}\n",b);
- X (void) fputs(".nr PO +0.3i\n",b);
- X (void) fputs(".so titlepage.ms\n",b);
- X (void) fputs(".pn 1\n",b);
- X (void) fputs(".bp\n",b);
- X (void) fputs(".ta 1.5i 3.0i 4.5i 6.0i 7.5i\n",b);
- X (void) fputs("\\&\n.sp 3\n.PP\n",b);
- X /* following line commented out by rjl
- X (void) fputs(".so intro\n",b);
- X */
- }
- X
- X
- convert(a,b)
- X FILE *a,*b;
- {
- X static char line[MAX_LINE_LEN];
- X
- X while (fgets(line,MAX_LINE_LEN,a)) {
- X process_line(line, b);
- X }
- }
- X
- process_line(line, b)
- X char *line;
- X FILE *b;
- {
- X switch(line[0]) { /* control character */
- X case '?': { /* interactive help entry */
- X break; /* ignore */
- X }
- X case '@': { /* start/end table */
- X if (intable) {
- X (void) fputs(".TE\n", b);
- X (void) fputs(".EQ\ndelim off\n.EN\n\n",b);
- X intable = FALSE;
- X } else {
- X (void) fputs("\n.EQ\ndelim $$\n.EN\n",b);
- X (void) fputs(".TS\ncenter box tab (@) ;\n", b);
- X (void) fputs("c c l .\n", b);
- X intable = TRUE;
- X }
- X /* ignore rest of line */
- X break;
- X }
- X case '#': { /* latex table entry */
- X break; /* ignore */
- X }
- X case '%': { /* troff table entry */
- X if (intable)
- X (void) fputs(line+1, b); /* copy directly */
- X else
- X fprintf(stderr, "error: % line found outside of table\n");
- X break;
- X }
- X case '\n': /* empty text line */
- X case ' ': { /* normal text line */
- X if (intable)
- X break; /* ignore while in table */
- X switch(line[1]) {
- X case ' ': {
- X /* verbatim mode */
- X fputs(".br\n",b);
- X fputs(line+1,b);
- X fputs(".br\n",b);
- X break;
- X }
- X case '\'': {
- X fputs("\\&",b);
- X putms(line+1,b);
- X break;
- X }
- X default: {
- X if (line[0] == '\n')
- X putms(line,b); /* handle totally blank line */
- X else
- X putms(line+1,b);
- X break;
- X }
- X break;
- X }
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X if (!intable) /* ignore while in table */
- X section(line, b);
- X } else
- X fprintf(stderr, "unknown control code '%c' in column 1\n",
- X line[0]);
- X break;
- X }
- X }
- }
- X
- X
- /* process a line with a digit control char */
- /* starts a new [sub]section */
- X
- section(line, b)
- X char *line;
- X FILE *b;
- {
- X static char string[MAX_LINE_LEN];
- X int sh_i;
- X static int old = 1;
- X
- X
- #ifdef AMIGA_LC_5_1
- X (void) sscanf(line,"%d",&sh_i);
- X strcpy(string,strchr(line,' ')+1);
- X {
- X char *p;
- X p = strchr(string,'\n');
- X if (p != NULL) *p = '\0';
- X }
- #else
- X (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
- #endif
- X
- X (void) fprintf(b,".sp %d\n",(sh_i == 1) ? LINE_SKIP : LINE_SKIP-1);
- X
- X if (sh_i > old) {
- X do
- X if (old!=1) /* this line added by rjl */
- X (void) fputs(".RS\n.IP\n",b);
- X while (++old < sh_i);
- X }
- X else if (sh_i < old) {
- X do
- X if (sh_i!=1) /* this line added by rjl */
- X (void) fputs(".RE\n.br\n",b);
- X while (--old > sh_i);
- X }
- X
- X /* added by dfk to capitalize section headers */
- X if (islower(string[0]))
- X string[0] = toupper(string[0]);
- X
- X /* next 3 lines added by rjl */
- X if (sh_i!=1)
- X (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i-1,string);
- X else
- X (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i,string);
- X old = sh_i;
- X
- X (void) fputs(".XS\n",b);
- X (void) fputs(string,b);
- X (void) fputs("\n.XE\n",b);
- }
- X
- putms(s, file)
- X char *s;
- X FILE *file;
- {
- X static boolean inquote = FALSE;
- X
- X while (*s != '\0') {
- X switch (*s) {
- X case '`': { /* backquote -> boldface */
- X if (inquote) {
- X fputs("\\fR", file);
- X inquote = FALSE;
- X } else {
- X fputs("\\fB", file);
- X inquote = TRUE;
- X }
- X break;
- X }
- X case '\\': { /* backslash */
- X fputs("\\\\", file);
- X break;
- X }
- X default: {
- X fputc(*s, file);
- X break;
- X }
- X }
- X s++;
- X }
- }
- X
- finish(b) /* spit out table of contents */
- FILE *b;
- {
- X (void) fputs(".pn 1\n",b);
- X (void) fputs(".ds RH %\n",b);
- X (void) fputs(".af % i\n",b);
- X (void) fputs(".bp\n.PX\n",b);
- }
- SHAR_EOF
- chmod 0644 gnuplot/docs/doc2ms.c ||
- echo 'restore of gnuplot/docs/doc2ms.c failed'
- Wc_c="`wc -c < 'gnuplot/docs/doc2ms.c'`"
- test 5125 -eq "$Wc_c" ||
- echo 'gnuplot/docs/doc2ms.c: original size 5125, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/docs/gnuplot.1 ==============
- if test -f 'gnuplot/docs/gnuplot.1' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/docs/gnuplot.1 (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/docs/gnuplot.1 (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/gnuplot.1' &&
- .\" 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
- honors all the standard X Toolkit options and resources such as geometry, font,
- foreground and background. See the X(1) man page for a description of
- the options. For color or grayscale displays \fIgnuplot\fP also honors
- the following resources (shown here with default values):
- .sp
- .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
- .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
- (pixar!info-gnuplot@sun.com)
- .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
- XX11 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
- XX(1).
- SHAR_EOF
- chmod 0644 gnuplot/docs/gnuplot.1 ||
- echo 'restore of gnuplot/docs/gnuplot.1 failed'
- Wc_c="`wc -c < 'gnuplot/docs/gnuplot.1'`"
- test 3718 -eq "$Wc_c" ||
- echo 'gnuplot/docs/gnuplot.1: original size 3718, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/docs/gnuplot.doc ==============
- if test -f 'gnuplot/docs/gnuplot.doc' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/docs/gnuplot.doc (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/docs/gnuplot.doc (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/gnuplot.doc' &&
- 1 gnuplot
- ?
- X GNUPLOT is a command-driven interactive function plotting program. It
- X is case sensitive (commands and function names written in lowercase
- X are not the same as those written in CAPS). All command names may be
- X abbreviated, as long as the abbreviation is not ambiguous. Any number
- X of commands may appear on a line, separated by semicolons (;).
- X Strings are indicated with quotes. They may be either single or double
- X quotation marks, e.g.,
- X
- X load "filename"
- X cd 'dir'
- X
- X Any command-line arguments are assumed to be names of files containing
- X GNUPLOT commands, with the exception of standard X11 arguments, which
- X are processed first. Each file is loaded with the `load` command, in the
- X order specified. GNUPLOT exits after the last file is processed. When
- X no load files are named, gnuplot enters into an interactive mode.
- X
- X Commands may extend over several input lines, by ending each
- X line but the last with a backslash (\). The backslash must be the LAST
- X character on each line. The effect is as if the backslash and newline
- X were not there. That is, no white space is implied, nor is a comment
- X terminated. Therefore, commenting out a continued line comments out
- X the entire command (see `comment`).
- X
- X In this documentation, curly braces ({}) denote optional arguments to
- X many commands, and a vertical bar (|) separates mutually exclusive
- X choices. GNUPLOT keywords or help topics are indicated by backquotes
- X or `boldface` (where available). Angle brackets (<>) are used to mark
- X replaceable tokens.
- X
- X For help on any topic, type `help` followed by the name of the topic.
- X
- X The new GNUPLOT user should begin by reading about the `plot`
- X command (type `help plot`).
- 2 cd
- ?cd
- X The `cd` command changes the working directory.
- X
- X Syntax:
- X cd "<directory-name>"
- X
- X The directory name must be enclosed in quotes.
- X
- X Examples:
- X cd 'subdir'
- X cd ".."
- 2 clear
- ?clear
- X The `clear` command erases the current screen or output device as
- X specified by `set output`. This usually generates a formfeed on
- X hardcopy devices. Use `set terminal` to set the device type.
- 2 command-line editing
- ?line-editing
- ?editing
- ?history
- X The Unix and IBM PC versions of GNUPLOT support command-line editing.
- X Also, a history mechanism allows previous commands to be edited, and
- X re-executed. After the command line has been edited, a newline or
- X carriage return will enter the entire line regardless of where the
- X cursor is positioned.
- X
- X The editing commands are as follows:
- X
- @start table - first is interactive cleartext form
- X `Line editing`:
- X
- X ^B moves back a single character.
- X ^F moves forward a single character.
- X ^A moves to the beginning of the line.
- X ^E moves to the end of the line.
- X ^H and DEL delete the previous character.
- X ^D deletes the current character.
- X ^K deletes from current position to the end of line.
- X ^L,^R redraws line in case it gets trashed.
- X ^U deletes the entire line.
- X ^W deletes the last word.
- X
- X `History`:
- X
- X ^P moves back through history.
- X ^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
- X
- X On the IBM PC the use of a TSR program such as DOSEDIT or CED may be
- X desired for line editing. For such a case GNUPLOT may be compiled with
- X no line editing capability (default makefile setup). Set READLINE in the
- X makefile and add readline.obj to the link file if GNUPLOT line editing
- X is to be used for the IBM PC. The following arrow keys may be used
- X on the IBM PC version if readline is used:
- X
- @start table - first is interactive cleartext form
- X Left Arrow - same as ^B.
- X Right Arrow - same as ^F.
- X Ctl Left Arrow - same as ^A.
- X Ctl Right Arrow - same as ^E.
- X Up Arrow - same as ^P.
- X 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
- 2 comment
- ?comments
- X Comments are supported as follows: a # may appear in most places in a line
- X and GNUPLOT will ignore the rest of the line. It will not have this
- X effect inside quotes, inside numbers (including complex numbers), inside
- X command substitutions, etc. In short, it works anywhere it makes sense
- X to work.
- 2 environment
- ?environment
- X A number of shell environment variables are understood by GNUPLOT.
- X None of these are required, but may be useful.
- X
- X If GNUTERM is defined, it is used as the name of the terminal type to
- X be used. This overrides any terminal type sensed by GNUPLOT on start
- X up, but is itself overridden by the .gnuplot (or equivalent) start-up
- X file (see `start-up`), and of course by later explicit changes.
- X
- X On Unix, AmigaDOS, and MS-DOS, GNUHELP may be defined to be the pathname
- X of the HELP file (gnuplot.gih).
- X
- X On VMS, the symbol GNUPLOT$HELP should be defined as the name of
- X the help library for GNUPLOT.
- X
- X On Unix, HOME is used as the name of a directory to search for
- X a .gnuplot file if none is found in the current directory.
- X On AmigaDOS and MS-DOS, GNUPLOT is used. On VMS, SYS$LOGIN: is used.
- X See help start-up.
- X
- X On Unix, PAGER is used as an output filter for help messages.
- X
- X On Unix and AmigaDOS, SHELL is used for the `shell` command. On MS-DOS,
- X COMSPEC is used for the `shell` command.
- X
- X On AmigaDOS, GNUFONT is used for the screen font. For example:
- X "setenv GNUFONT sapphire/14".
- X
- X On MS-DOS, if the BGI interface is used, the variable `BGI` is used to point
- X to the full path to the BGI drivers directory. Furthermore SVGA is used to
- X name the Super VGA BGI driver in 800x600 res., and its mode of operation
- X as 'Name.Mode'.
- X For example, if the Super VGA driver is C:\TC\BGI\SVGADRV.BGI and mode 3 is
- X used for 800x600 res., then: 'set BGI=C:\TC\BGI' and 'set SVGA=SVGADRV.3'.
- 2 exit
- ?exit
- ?quit
- X The commands `exit` and `quit` and the END-OF-FILE character
- X will exit GNUPLOT. All these commands will clear the output device
- X (as the `clear` command does) before exiting.
- 2 expressions
- ?expressions
- X In general, any mathematical expression accepted by C, FORTRAN,
- X Pascal, or BASIC is valid. The precedence of these operators is
- X determined by the specifications of the C programming language.
- X White space (spaces and tabs) is ignored inside expressions.
- X
- X Complex constants may be expressed as the {<real>,<imag>}, where <real>
- X and <imag> must be numerical constants. For example, {3,2}
- X represents 3 + 2i; {0,1} represents `i` itself. The curly braces
- X are explicitly required here.
- 3 functions
- ?expressions functions
- ?functions
- X The functions in GNUPLOT are the same as the corresponding functions
- X in the Unix math library, except that all functions accept integer,
- X real, and complex arguments, unless otherwise noted. The `sgn`
- X 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}$
- X The `abs` function returns the absolute value of its argument. The
- X returned value is of the same type as the argument.
- X
- X For complex arguments, abs(x) is defined as the length of x in the
- X 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
- X The `acos` function returns the arc cosine (inverse cosine) of its
- X 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
- X 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
- X The `asin` function returns the arc sin (inverse sin) of its argument.
- X `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
- X The `atan` function returns the arc tangent (inverse tangent) of its
- X 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$
- X The `besj0` function returns the j0th Bessel function of its argument.
- X `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$
- X The `besj1` function returns the j1st Bessel function of its argument.
- X `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$
- X The `besy0` function returns the y0th Bessel function of its argument.
- X `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$
- X The `besy1` function returns the y1st Bessel function of its argument.
- X `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)
- X The `ceil` function returns the smallest integer that is not less than its
- X argument. For complex numbers, `ceil` returns the smallest integer
- X 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$
- X The `cos` function returns the cosine of its argument. `cos` expects its
- X 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$
- X The `cosh` function returns the hyperbolic cosine of its argument.
- X `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$
- X The `exp` function returns the exponential function of its argument
- X (`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)
- X The `floor` function returns the largest integer not greater than its
- X argument. For complex numbers, `floor` returns the largest
- X 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$)
- X The `gamma` function returns the gamma function of the real part of
- X its argument. For integer n, gamma(n+1) = n! .
- X 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
- X The `imag` function returns the imaginary part of its argument as a
- X 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
- X The `int` function returns the integer part of its argument, truncated
- X 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$
- X The `log` function returns the natural logarithm (base `e`) of its
- X 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$
- 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$
- 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
- X The `sgn` function returns 1 if its argument is positive, -1 if its
- X argument is negative, and 0 if its argument is 0. If the argument
- X 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$
- X The `sin` function returns the sine of its argument. `sin` expects its
- X 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$
- X The `sinh` function returns the hyperbolic sine of its argument. `sinh`
- X 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$
- 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$
- X The `tan` function returns the tangent of its argument. `tan` expects
- X 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$
- X The `tanh` function returns the hyperbolic tangent of its argument.
- X `tanh` expects its argument to be in radians.
- @end table
- 3 operators
- ?expressions operators
- ?operators
- X The operators in GNUPLOT are the same as the corresponding operators
- X in the C programming language, except that all operators accept
- X integer, real, and complex arguments, unless otherwise noted.
- X The ** operator (exponentiation) is supported, as in FORTRAN.
- X
- X Parentheses may be used to change order of evaluation.
- 4 binary
- ?expressions operators binary
- ?operators binary
- ?binary
- X The following is a list of all the binary operators and their
- X usages:
- X
- @start table - first is interactive cleartext form
- X Symbol Example Explanation
- X ** a**b exponentiation
- X * a*b multiplication
- X / a/b division
- X % a%b * modulo
- X + a+b addition
- X - a-b subtraction
- X == a==b equality
- X != a!=b inequality
- X & a&b * bitwise AND
- X ^ a^b * bitwise exclusive OR
- X | a|b * bitwise inclusive OR
- X && a&&b * logical AND
- X || a||b * logical OR
- X ?: 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
- X
- @end table
- X (*) Starred explanations indicate that the operator requires
- X integer arguments.
- X
- X Logical AND (&&) and OR (||) short-circuit the way they do in C.
- X That is, the second && operand is not evaluated if the first is
- X false; the second || operand is not evaluated if the first is true.
- X
- X The ternary operator evaluates its first argument (a). If it is
- X true (non-zero) the second argument (b) is evaluated and returned,
- X otherwise the third argument (c) is evaluated and returned.
- 4 unary
- ?expressions operators unary
- ?operators unary
- ?unary
- X The following is a list of all the unary operators and their
- X usages:
- X
- @start table - first is interactive cleartext form
- X Symbol Example Explanation
- X - -a unary minus
- X ~ ~a * one's complement
- X ! !a * logical negation
- X ! 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
- X
- @end table
- X (*) Starred explanations indicate that the operator requires an
- X integer argument.
- X
- X The factorial operator returns a real number to allow a greater range.
- 2 help
- ?help
- X The `help` command displays on-line help. To specify information on a
- X particular topic use the syntax:
- X
- X help {<topic>}
- X
- X If <topic> is not specified, a short message is printed about
- X GNUPLOT. After help for the requested topic is given, help for a
- X subtopic may be requested by typing its name, extending the help
- X request. After that subtopic has been printed, the request may be
- X extended again, or simply pressing return goes back one level to the
- X previous topic. Eventually, the GNUPLOT command line will return.
- 2 load
- ?load
- X The `load` command executes each line of the specified input file as
- X if it had been typed in interactively. Files created by the `save`
- X command can later be `load`ed. Any text file containing valid
- X commands can be created and then executed by the `load` command.
- X Files being `load`ed may themselves contain `load` commands. See
- X `comment` for information about comments in commands.
- X
- X The `load` command must be the last command on the line.
- X
- X Syntax:
- X load "<input-file>"
- X
- X The name of the input file must be enclosed in quotes.
- X
- X Examples:
- X
- X load 'work.gnu'
- X load "func.dat"
- X
- X The `load` command is performed implicitly on any file names given as
- X arguments to GNUPLOT. These are loaded in the order specified, and
- X then GNUPLOT exits.
- 2 pause
- ?pause
- X The `pause` command displays any text associated with the command and
- X then waits a specified amount of time or until the carriage return is
- X pressed. `pause` is especially useful in conjunction with `load` files.
- X
- X Syntax:
- X pause <time> {"<string>"}
- X
- X <time> may be any integer constant or expression. Choosing -1 will
- X wait until a carriage return is hit, zero (0) won't pause at all, and
- X a positive integer will wait the specified number of seconds.
- X
- X Note: Since `pause` is not part of the plot it may interact with
- X different device drivers differently (depending upon how text and
- X graphics are mixed).
- X
- X Examples:
- X pause -1 # Wait until a carriage return is hit
- X pause 3 # Wait three seconds
- X pause -1 "Hit return to continue"
- X pause 10 "Isn't this pretty? It's a cubic-spline."
- X
- 2 plot
- ?plot
- ?splot
- X `plot` and `splot` are the primary commands of the program. They plot
- X functions and data in many, many ways. `plot` is used to plot 2-d
- X functions and data, while `splot` plots 3-d surfaces and data.
- X
- X Syntax:
- X
- X plot {ranges} <function> {title} {style}
- X {, <function> {title} {style}...}
- X
- X splot {ranges} <function> {title} {style}
- X {, <function> {title} {style}...}
- X
- X where <function> is either a mathematical expression, the name of a
- X data file enclosed in quotes, or a pair (`plot`) or triple (`splot`)
- X of mathematical expressions in the case of parametric functions.
- X User-defined functions and variables may also be defined here.
- X
- X `plot` and `splot` commands can be as simple as
- X
- X plot sin(x)
- X
- X and
- X
- X splot x * y
- X
- X or as complex as (!)
- X
- X 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
- X Discrete data contained in a file can displayed by specifying the
- X name of the data file (enclosed in quotes) on the `plot` or `splot`
- X command line. Data files should contain one data point per line.
- X Lines beginning with # (or ! on VMS) will be treated as comments
- X and ignored. For `plot`s, each data point represents an (x,y)
- X pair. For `splot`s, each point is an (x,y,z) triple. For `plot`s with
- X error bars (see `plot errorbars`), each data point is either
- X (x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
- X line of a data file must be separated by blank space. This blank
- X space divides each line into columns.
- X
- X For `plot`s the x value may be omitted, and for `splot`s the x
- X and y values may be omitted. In either case the omitted values are
- X assigned the current coordinate number. Coordinate numbers start at 0
- X and are incremented for each data point read.
- X
- X To specify other formats, see `plot datafile using`.
- X
- X In the `plot` command, blank lines in the data file cause a break in
- X the plot. There will be no line drawn between the preceding and
- X following points if the plot style is `lines` or `linespoints` (see
- X `plot style`). This does not change the plot style, as would plotting
- X the data as separate curves.
- X
- X This example compares the data in the file population.dat to a
- X theoretical curve:
- X
- X pop(x) = 103*exp((1965-x)/10)
- X plot [1960:1990] 'population.dat', pop(x)
- X
- X The file population.dat might contain:
- X
- X # Gnu population in Antarctica since 1965
- X 1965 103
- X 1970 55
- X 1975 34
- X 1980 24
- X 1985 10
- X
- X When a data file is plotted, `samples` and `iso_samples` are ignored.
- X Curves plotted using the `plot` command are automatically extended to
- X hold the entire curve. Similarly grid data plotted using the `splot`
- X command is automatically extended, using the assumption that isolines
- X are separated by blank lines (a line with only a CR/LF in it).
- X
- X Implicitly, there are two types of 3-d datafiles. If all the isolines
- X are of the same length, the data is assumed to be a grid data, i.e.,
- X the data has a grid topology. Cross isolines in the other parametric
- X direction (the ith cross isoline passes thru the ith point of all the
- X provided isolines) will also be drawn for grid data. (Note contouring
- X is available for grid data only.) If all the isolines are not of the
- X same length, no cross isolines will be drawn and contouring that data
- X is impossible.
- X
- X For splot if 3-d datafile and using format (see `splot datafile using`)
- X specify only z (height field), a non parametric mode must be specified.
- X If, on the other hand, x, y, and z are all specified, a parametric
- X mode should be selected (see `set parametric`) since data is defining a
- X parametric surface.
- X
- X A simple example of plotting a 3-d data file is
- X
- X splot 'glass.dat'
- X
- X 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
- X The format of data within a file can be selected with the `using`
- X option. An explicit scanf string can be used, or simpler column
- X choices can be made.
- X
- X Syntax:
- X
- X plot "datafile" { using { <ycol> |
- X <xcol>:<ycol> |
- X <xcol>:<ycol>:<ydelta> |
- X <xcol>:<ycol>:<ylow>:<yhigh> }
- X {"<scanf string>"} } ...
- X
- X and
- X
- X splot "datafile" { using { <xcol>:<ycol>:<zcol> | <zcol> }
- X {"<scanf string>"} } ...
- X
- X <xcol>, <ycol>, and <zcol> explicitly select the columns to plot from
- X a space or tab separated multicolumn data file. If only <ycol> is
- X selected for `plot`, <xcol> defaults to 1. If only <zcol> is selected
- X for `splot`, then only that column is read from the file. An <xcol> of
- X 0 forces <ycol> to be plotted versus its coordinate number. <xcol>,
- X <ycol>, and <zcol> can be entered as constants or expressions.
- X
- X If errorbars (see also `plot errorbars`) are used for `plot`s,
- X ydelta (for example, a +/- error) should be provided as the third
- X column, or ylow and yhigh as third and fourth columns. These columns
- X must follow the x and y columns.
- X
- X Scanf strings override any <xcol>:<ycol>(:<zcol>) choices, except for
- X ordering of input, e.g.,
- X plot "datafile" using 2:1 "%f%*f%f"
- X causes the first column to be y and the third column to be x.
- X
- X If the scanf string is omitted, the default is generated based on the
- X <xcol>:<ycol>(:<zcol>) choices. If the `using` option is omitted, "%f%f"
- X is used for `plot` ("%f%f%f%f" for `errorbar` `plot`s) and "%f%f%f" is
- X used for `splot`.
- X
- X Examples:
- X
- X plot "MyData" using "%*f%f%*20[^\n]%f" with lines
- X
- X Data are read from the file "MyData" using the format
- X "%*f%f%*20[^\n]%f". The meaning of this format is: "%*f" ignore the
- X first number, "%f" then read in the second and assign to x,
- X "%*20[^\n]" then ignore 20 non-newline characters, "%f" then read in
- X the y value.
- X
- X n=3;
- X plot "MyData", "MyData" using n
- X
- X causes GNUPLOT to plot the second and third columns of MyData versus
- X the first column. The command 'n=4; replot' would then plot the second
- X and fourth columns of MyData versus the first column.
- X
- X splot "glass.dat" using 1
- X
- X causes GNUPLOT to plot the first coordinate of the points of glass.dat
- X as the z coordinate while ignoring the other two coordinates.
- X
- X Note: GNUPLOT first reads a line of the data file into a buffer and
- X then does a
- X sscanf(input_buffer, scanf_string, &x, &y{, &z});
- X where 'x', 'y', and 'z' are of type 'float'. Any scanf string that
- X specifies two (three for `splot`, three or four for `errorbars`) float
- X numbers may be used.
- 3 errorbars
- ?plot errorbars
- ?errorbars
- X Error bars are supported for 2-d data file plots by reading one or
- X two additional columns specifying ydelta or ylow and yhigh
- X respectively. No support exists for x error bars or any error bars
- X for `splot`s.
- X
- X In the default situation, GNUPLOT expects to see three or four
- X numbers on each line of the data file, either (x, y, ydelta) or
- X (x, y, ylow, yhigh). The x coordinate must be specified. The order
- X of the numbers must be exactly as given above. Data files in this
- X format can easily be plotted with error bars:
- X
- X plot "data.dat" with errorbars
- X
- X The error bar is a vertical line plotted from (x, ylow) to (x,
- X yhigh). If ydelta is specified instead of ylow and yhigh,
- X ylow=y-ydelta and yhigh=y+ydelta are derived. If there
- X are only two numbers on the line, yhigh and ylow are both set to
- X y. To get lines plotted between the data points, `plot` the
- X data file twice, once with errorbars and once with lines.
- X
- X If y autoscaling is on, the y range will be adjusted to fit the
- X error bars.
- X
- X The `using` option may be used to specify how columns of the data file
- X are to be assigned to x, y, ydelta, ylow, and yhigh. The x column must
- X be provided and both the x and y columns must appear before the
- X errorbar columns. If three column numbers are given, they are x, y,
- X and ydelta. If four columns are given, they are x, y, ylow, and
- X yhigh.
- X
- X Examples:
- X
- X plot "data.dat" using 1:2:3:4 with errorbars
- X plot "data.dat" using 3:2:6 with errorbars
- X plot "data.dat" using 3:4:8:7 with errorbars
- X
- X The first example reads, x, y, ylow, and yhigh, from columns 1, 2, 3,
- X and 4. This is equivalent to the default. The second example reads x
- X from the third column, y from second and ydelta from the sixth column.
- X The third example reads x from the third column, y from the fourth,
- X ylow from the eighth, and yhigh from seventh columns.
- X
- X See also `plot using` and `plot style`.
- 3 parametric
- ?plot parametric
- ?splot parametric
- ?parametric
- X When in parametric mode (`set parametric`) mathematical expressions must
- X be given in pairs for `plot` and in triplets for `splot`:
- X plot sin(t),t**2
- X or
- X splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
- X
- X Data files are plotted as before, except any preceding parametric
- X function must be fully specified before a data file is given as a
- X plot. In other words, the x parametric function (sin(t) above) and
- X the y parametric function (t**2 above) must not be interrupted with
- X any modifiers or data functions; doing so will generate a syntax error
- X stating that the parametric function is not fully specified.
- X
- X Ranges take on a different meaning when in parametric mode. The first
- X range on the `plot` command is the `trange`, the next is the `xrange`,
- X and the last is the `yrange`. For `splot` the order is `urange`,
- X `vrange`, `xrange`, `yrange`, and finally `zrange`. The following
- X `plot` command shows setting the `trange` to [-pi:pi], the `xrange` to
- X [-1.3:1.3] and the `yrange` to [-1:1] for the duration of the plot:
- X plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
- X
- X Other modifiers, such as `with` and `title`, may be specified only
- X after the parametric function has been completed:
- X plot sin(t),t**2 title 'Parametric example' with linespoints
- 3 ranges
- ?splot ranges
- ?plot ranges
- ?ranges
- X The optional range specifies the region of the plot that will be
- X displayed.
- X
- X Ranges may be provided on the `plot` and `splot` command line and
- X affect only that plot, or in the `set xrange`, `set yrange`, etc.,
- X commands, to change the default ranges for future plots.
- X
- X Syntax:
- X [{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }
- X
- X where <dummy-var> is the independent variable (the defaults are x and
- X y, but this may be changed with `set dummy`) and the min and max
- X terms can be constant expressions.
- X
- X Both the min and max terms are optional. The ':' is also optional
- X if neither a min nor a max term is specified. This allows '[ ]' to
- X be used as a null range specification.
- X
- X Specifying a range in the `plot` command line turns autoscaling for
- X that axis off for that plot. Using one of the `set` range commands
- X turns autoscaling off for that axis for future plots, unless changed
- X later. (See `set autoscale`).
- X
- X Examples:
- X
- X This uses the current ranges:
- X plot cos(x)
- X
- X This sets the x range only:
- X plot [-10:30] sin(pi*x)/(pi*x)
- X
- X This is the same, but uses t as the dummy-variable:
- X plot [t = -10 :30] sin(pi*t)/(pi*t)
- X
- X This sets both the x and y ranges:
- X plot [-pi:pi] [-3:3] tan(x), 1/x
- X
- X This sets only the y range, and turns off autoscaling on both axes:
- X plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
- X
- X This sets xmax and ymin only:
- X plot [:200] [-pi:] exp(sin(x))
- X
- X This sets the x, y, and z ranges:
- X splot [0:3] [1:4] [-1:1] x*y
- 3 style
- ?plot style
- ?splot style
- ?style
- ?plot with
- ?with
- X Plots may be displayed in one of six styles: `lines`, `points`,
- X `linespoints`, `impulses`, `dots`, or `errorbars`. The `lines` style
- X connects adjacent points with lines. The `points` style displays a
- X small symbol at each point. The `linespoints` style does both
- X `lines` and `points`. The `impulses` style displays a vertical line
- X from the x axis (or from the grid base for `splot`) to each point. The
- X `dots` style plots a tiny dot at each point; this is useful for
- X scatter plots with many points.
- X
- X The `errorbars` style is only relevant to 2-d data file plotting. It
- X is treated like `points` for `splot`s and function `plot`s. For data
- X `plot`s, `errorbars` is like `points`, except that a vertical error
- X bar is also drawn: for each point (x,y), a line is drawn from
- X (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
- X bar. The ylow and yhigh values are read from the data file's columns,
- X as specified with the `using` option to plot. See `plot errorbars` for
- X more information.
- X
- X Default styles are chosen with the `set function style` and
- X `set data style` commands.
- X
- X By default, each function and data file will use a different
- X line type and point type, up to the maximum number of available
- X types. All terminal drivers support at least six different point
- X types, and re-use them, in order, if more than six are required.
- X The LaTeX driver supplies an additional six point types (all variants
- X of a circle), and thus will only repeat after twelve curves are
- X plotted with points.
- X
- X If desired, the style and (optionally) the line type and point type
- X used for a curve can be specified.
- X
- X Syntax:
- X
- X with <style> {<linetype> {<pointtype>}}
- X
- X where <style> is either `lines`, `points`, `linespoints`, `impulses`,
- SHAR_EOF
- true || echo 'restore of gnuplot/docs/gnuplot.doc failed'
- fi
- echo 'End of part 8'
- echo 'File gnuplot/docs/gnuplot.doc is continued in part 9'
- echo 9 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-