home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume24 / gnuplot3 / part08 < prev    next >
Encoding:
Text File  |  1991-10-26  |  48.3 KB  |  1,470 lines

  1. Newsgroups: comp.sources.misc
  2. From: gershon%gr@cs.utah.edu (Elber Gershon)
  3. Subject:  v24i030:  gnuplot3 - interactive function plotting utility, Part08/26
  4. Message-ID: <1991Oct26.222356.6572@sparky.imd.sterling.com>
  5. X-Md4-Signature: a62c77c6dc395bc4f18e49a7ee6f3fef
  6. Date: Sat, 26 Oct 1991 22:23:56 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: gershon%gr@cs.utah.edu (Elber Gershon)
  10. Posting-number: Volume 24, Issue 30
  11. Archive-name: gnuplot3/part08
  12. Environment: UNIX, MS-DOS, VMS
  13. Supersedes: gnuplot2: Volume 11, Issue 65-79
  14.  
  15. #!/bin/sh
  16. # this is Part.08 (part 8 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file gnuplot/docs/doc2hlp.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 8; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping gnuplot/docs/doc2hlp.c'
  34. else
  35. echo 'x - continuing file gnuplot/docs/doc2hlp.c'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'gnuplot/docs/doc2hlp.c' &&
  37. X          (void) fputs(line,b); 
  38. X          break;
  39. X       }
  40. X       default: {
  41. X          if (isdigit(line[0])) { /* start of section */
  42. X            (void) fputs(line,b); 
  43. X          } else
  44. X            fprintf(stderr, "unknown control code '%c' in column 1, line %d\n", 
  45. X                  line[0], line_count);
  46. X          break;
  47. X       }
  48. X    }
  49. }
  50. SHAR_EOF
  51. echo 'File gnuplot/docs/doc2hlp.c is complete' &&
  52. chmod 0666 gnuplot/docs/doc2hlp.c ||
  53. echo 'restore of gnuplot/docs/doc2hlp.c failed'
  54. Wc_c="`wc -c < 'gnuplot/docs/doc2hlp.c'`"
  55. test 1471 -eq "$Wc_c" ||
  56.     echo 'gnuplot/docs/doc2hlp.c: original size 1471, current size' "$Wc_c"
  57. rm -f _shar_wnt_.tmp
  58. fi
  59. # ============= gnuplot/docs/doc2hlp.com ==============
  60. if test -f 'gnuplot/docs/doc2hlp.com' -a X"$1" != X"-c"; then
  61.     echo 'x - skipping gnuplot/docs/doc2hlp.com (File already exists)'
  62.     rm -f _shar_wnt_.tmp
  63. else
  64. > _shar_wnt_.tmp
  65. echo 'x - extracting gnuplot/docs/doc2hlp.com (Text)'
  66. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/doc2hlp.com' &&
  67. $ def/user sys$input [.docs]gnuplot.doc
  68. $ def/user sys$output []gnuplot.hlp
  69. $ run doc2hlp
  70. SHAR_EOF
  71. chmod 0666 gnuplot/docs/doc2hlp.com ||
  72. echo 'restore of gnuplot/docs/doc2hlp.com failed'
  73. Wc_c="`wc -c < 'gnuplot/docs/doc2hlp.com'`"
  74. test 90 -eq "$Wc_c" ||
  75.     echo 'gnuplot/docs/doc2hlp.com: original size 90, current size' "$Wc_c"
  76. rm -f _shar_wnt_.tmp
  77. fi
  78. # ============= gnuplot/docs/doc2ms.c ==============
  79. if test -f 'gnuplot/docs/doc2ms.c' -a X"$1" != X"-c"; then
  80.     echo 'x - skipping gnuplot/docs/doc2ms.c (File already exists)'
  81.     rm -f _shar_wnt_.tmp
  82. else
  83. > _shar_wnt_.tmp
  84. echo 'x - extracting gnuplot/docs/doc2ms.c (Text)'
  85. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/doc2ms.c' &&
  86. /*
  87. X * doc2ms.c  -- program to convert Gnuplot .DOC format to *roff -ms document
  88. X * From hlp2ms by Thomas Williams 
  89. X *
  90. X * Modified by Russell Lang, 2nd October 1989
  91. X * to make vms help level 1 and 2 create the same ms section level.
  92. X *
  93. X * Modified to become doc2ms by David Kotz (David.Kotz@Dartmouth.edu) 12/89
  94. X * Added table and backquote support.
  95. X *
  96. X * usage:  doc2ms < file.doc > file.ms
  97. X *
  98. X *   where file.doc is a VMS .DOC file, and file.ms will be a [nt]roff
  99. X *     document suitable for printing with nroff -ms or troff -ms
  100. X *
  101. X * typical usage for GNUPLOT:
  102. X *
  103. X *   doc2ms < gnuplot.doc | troff -ms
  104. X */
  105. X
  106. static char rcsid[] = "$Id: doc2ms.c,v 1.1 90/01/11 15:43:54 dfk Exp Locker: dfk $";
  107. X
  108. #include <stdio.h>
  109. #include <ctype.h>
  110. #ifdef AMIGA_LC_5_1
  111. #include <string.h>
  112. #endif
  113. X
  114. #define MAX_NAME_LEN    256
  115. #define MAX_LINE_LEN    256
  116. #define LINE_SKIP        3
  117. X
  118. #define TRUE 1
  119. #define FALSE 0
  120. X
  121. typedef int boolean;
  122. X
  123. static boolean intable = FALSE;
  124. X
  125. main()
  126. {
  127. X    init(stdout);
  128. X    convert(stdin,stdout);
  129. X    finish(stdout);
  130. X    exit(0);
  131. }
  132. X
  133. X
  134. init(b)
  135. FILE *b;
  136. {
  137. X    /* in nroff, increase line length by 8 and don't adjust lines */
  138. X    (void) fputs(".if n \\{.nr LL +8m\n.na \\}\n",b);
  139. X    (void) fputs(".nr PO +0.3i\n",b);
  140. X    (void) fputs(".so titlepage.ms\n",b);
  141. X    (void) fputs(".pn 1\n",b);
  142. X    (void) fputs(".bp\n",b);
  143. X    (void) fputs(".ta 1.5i 3.0i 4.5i 6.0i 7.5i\n",b);
  144. X    (void) fputs("\\&\n.sp 3\n.PP\n",b);
  145. X    /* following line commented out by rjl
  146. X      (void) fputs(".so intro\n",b);
  147. X      */
  148. }
  149. X
  150. X
  151. convert(a,b)
  152. X    FILE *a,*b;
  153. {
  154. X    static char line[MAX_LINE_LEN];
  155. X
  156. X    while (fgets(line,MAX_LINE_LEN,a)) {
  157. X       process_line(line, b);
  158. X    }
  159. }
  160. X
  161. process_line(line, b)
  162. X    char *line;
  163. X    FILE *b;
  164. {
  165. X    switch(line[0]) {        /* control character */
  166. X       case '?': {            /* interactive help entry */
  167. X          break;            /* ignore */
  168. X       }
  169. X       case '@': {            /* start/end table */
  170. X          if (intable) {
  171. X             (void) fputs(".TE\n", b);
  172. X             (void) fputs(".EQ\ndelim off\n.EN\n\n",b);
  173. X             intable = FALSE;
  174. X          } else {
  175. X             (void) fputs("\n.EQ\ndelim $$\n.EN\n",b);
  176. X             (void) fputs(".TS\ncenter box tab (@) ;\n", b);
  177. X             (void) fputs("c c l .\n", b);
  178. X             intable = TRUE;
  179. X          }
  180. X          /* ignore rest of line */
  181. X          break;
  182. X       }
  183. X       case '#': {            /* latex table entry */
  184. X          break;            /* ignore */
  185. X       }
  186. X       case '%': {            /* troff table entry */
  187. X          if (intable)
  188. X            (void) fputs(line+1, b); /* copy directly */
  189. X          else
  190. X            fprintf(stderr, "error: % line found outside of table\n");
  191. X          break;
  192. X       }
  193. X       case '\n':            /* empty text line */
  194. X       case ' ': {            /* normal text line */
  195. X          if (intable)
  196. X            break;        /* ignore while in table */
  197. X          switch(line[1]) {
  198. X             case ' ': {
  199. X                /* verbatim mode */
  200. X                fputs(".br\n",b); 
  201. X                fputs(line+1,b); 
  202. X                fputs(".br\n",b);
  203. X                break;
  204. X             }
  205. X             case '\'': {
  206. X                fputs("\\&",b);
  207. X                putms(line+1,b); 
  208. X                break;
  209. X             }
  210. X             default: {
  211. X                if (line[0] == '\n')
  212. X                  putms(line,b); /* handle totally blank line */
  213. X                else
  214. X                  putms(line+1,b);
  215. X                break;
  216. X             }
  217. X             break;
  218. X          }
  219. X          break;
  220. X       }
  221. X       default: {
  222. X          if (isdigit(line[0])) { /* start of section */
  223. X             if (!intable)    /* ignore while in table */
  224. X               section(line, b);
  225. X          } else
  226. X            fprintf(stderr, "unknown control code '%c' in column 1\n", 
  227. X                  line[0]);
  228. X          break;
  229. X       }
  230. X    }
  231. }
  232. X
  233. X
  234. /* process a line with a digit control char */
  235. /* starts a new [sub]section */
  236. X
  237. section(line, b)
  238. X    char *line;
  239. X    FILE *b;
  240. {
  241. X    static char string[MAX_LINE_LEN];
  242. X    int sh_i;
  243. X    static int old = 1;
  244. X
  245. X  
  246. #ifdef AMIGA_LC_5_1
  247. X    (void) sscanf(line,"%d",&sh_i);
  248. X    strcpy(string,strchr(line,' ')+1);
  249. X    {
  250. X      char *p;
  251. X      p = strchr(string,'\n');
  252. X      if (p != NULL) *p = '\0';
  253. X    }
  254. #else
  255. X    (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
  256. #endif
  257. X    
  258. X    (void) fprintf(b,".sp %d\n",(sh_i == 1) ? LINE_SKIP : LINE_SKIP-1);
  259. X    
  260. X    if (sh_i > old) {
  261. X       do
  262. X        if (old!=1)    /* this line added by rjl */
  263. X          (void) fputs(".RS\n.IP\n",b);
  264. X       while (++old < sh_i);
  265. X    }
  266. X    else if (sh_i < old) {
  267. X       do
  268. X               if (sh_i!=1) /* this line added by rjl */
  269. X                (void) fputs(".RE\n.br\n",b);
  270. X       while (--old > sh_i);
  271. X    }
  272. X    
  273. X    /* added by dfk to capitalize section headers */
  274. X    if (islower(string[0]))
  275. X     string[0] = toupper(string[0]);
  276. X    
  277. X    /* next 3 lines added by rjl */
  278. X    if (sh_i!=1) 
  279. X     (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i-1,string);
  280. X    else 
  281. X     (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i,string);
  282. X    old = sh_i;
  283. X    
  284. X    (void) fputs(".XS\n",b);
  285. X    (void) fputs(string,b);
  286. X    (void) fputs("\n.XE\n",b);
  287. }
  288. X
  289. putms(s, file)
  290. X    char *s;
  291. X    FILE *file;
  292. {
  293. X    static boolean inquote = FALSE;
  294. X
  295. X    while (*s != '\0') {
  296. X       switch (*s) {
  297. X          case '`': {        /* backquote -> boldface */
  298. X             if (inquote) {
  299. X                fputs("\\fR", file);
  300. X                inquote = FALSE;
  301. X             } else {
  302. X                fputs("\\fB", file);
  303. X                inquote = TRUE;
  304. X             }
  305. X             break;
  306. X          }
  307. X          case '\\': {        /* backslash */
  308. X             fputs("\\\\", file);
  309. X             break;
  310. X          }
  311. X          default: {
  312. X             fputc(*s, file);
  313. X             break;
  314. X          }
  315. X       }
  316. X       s++;
  317. X    }
  318. }
  319. X
  320. finish(b)        /* spit out table of contents */
  321. FILE *b;
  322. {
  323. X    (void) fputs(".pn 1\n",b);
  324. X    (void) fputs(".ds RH %\n",b);
  325. X    (void) fputs(".af % i\n",b);
  326. X    (void) fputs(".bp\n.PX\n",b);
  327. }
  328. SHAR_EOF
  329. chmod 0644 gnuplot/docs/doc2ms.c ||
  330. echo 'restore of gnuplot/docs/doc2ms.c failed'
  331. Wc_c="`wc -c < 'gnuplot/docs/doc2ms.c'`"
  332. test 5125 -eq "$Wc_c" ||
  333.     echo 'gnuplot/docs/doc2ms.c: original size 5125, current size' "$Wc_c"
  334. rm -f _shar_wnt_.tmp
  335. fi
  336. # ============= gnuplot/docs/gnuplot.1 ==============
  337. if test -f 'gnuplot/docs/gnuplot.1' -a X"$1" != X"-c"; then
  338.     echo 'x - skipping gnuplot/docs/gnuplot.1 (File already exists)'
  339.     rm -f _shar_wnt_.tmp
  340. else
  341. > _shar_wnt_.tmp
  342. echo 'x - extracting gnuplot/docs/gnuplot.1 (Text)'
  343. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/gnuplot.1' &&
  344. .\" dummy line
  345. .TH GNUPLOT 1 "31 August 1990"
  346. .UC 4
  347. .SH NAME
  348. gnuplot \- an interactive plotting program
  349. .SH SYNOPSIS
  350. .B gnuplot
  351. [ X11 options ] [file ...]
  352. .br
  353. .SH DESCRIPTION
  354. .I Gnuplot 
  355. is a command-driven interactive function plotting program.
  356. .PP
  357. If files are given, 
  358. .I gnuplot 
  359. loads each file with the 
  360. .I load
  361. command, in the order specified.
  362. .I Gnuplot 
  363. exits after the last file is processed.
  364. .PP
  365. Here are some of its features:
  366. .PP
  367. Plots any number of functions, built up of C operators, C library
  368. functions, and some things C doesn't have like **, sgn(), etc.  Also
  369. support for plotting data files, to compare actual
  370. data to theoretical curves.
  371. .PP
  372. User-defined X and Y ranges (optional auto-ranging), smart axes scaling,
  373. smart tic marks.
  374. .PP
  375. Labelling of X and Y axes.
  376. .PP
  377. User-defined constants and functions.
  378. .PP
  379. Support through a generalized graphics driver for
  380. AED 512,
  381. AED 767,
  382. BBN BitGraph,
  383. Commodore Amiga,
  384. Roland DXY800A,
  385. EEPIC,
  386. EmTeX,
  387. Epson 60dpi printers,
  388. Epson LX-800,
  389. Fig, 
  390. HP2623,
  391. HP2648,
  392. HP75xx,
  393. HPGL,
  394. HP LaserJet II,
  395. Imagen,
  396. Iris 4D,
  397. Kermit-MS,
  398. Kyocera laser printer,
  399. LaTeX,
  400. NEC CP6 pinwriter,
  401. PostScript,
  402. QMS QUIC,
  403. ReGis (VT125 and VT2xx),
  404. SCO Xenix CGI,
  405. Selanar,
  406. Star color printer,
  407. Tandy DMP-130 printer,
  408. Tek 401x,
  409. Tek 410x,
  410. Vectrix 384,
  411. VT like tekronix emulator,
  412. Unix PC (ATT 3b1 or ATT 7300),
  413. unixplot,  
  414. and X11.
  415. The PC version compiled by Microsoft C
  416. supports IBM CGA, EGA, VGA, Hercules, ATT 6300,
  417. and Corona 325 graphics.  
  418. The PC version compiled by Turbo C
  419. supports IBM CGA, EGA, MCGA, VGA, Hercules and ATT 6300 graphics.  
  420. Other devices can be added simply, but will require recompiling.
  421. .PP
  422. Shell escapes and command line substitution.
  423. .PP
  424. Load and save capability.
  425. .PP
  426. Output redirection.
  427. .PP
  428. All computations performed in the complex domain.  Just the real part is
  429. plotted by default, but functions like imag() and abs() and arg() are
  430. available to override this.
  431. .SH X11 OPTIONS
  432. .I Gnuplot 
  433. provides two terminal types (\fIx11\fP and \fIX11\fP) for use
  434. with X servers. The \fIX11\fP terminal type provides differing colors as well 
  435. as shapes for the \fIpoints\fP plotting style. The two types are otherwise 
  436. identical.  When used with either of these terminal types, \fIgnuplot\fP
  437. honors all the standard X Toolkit options and resources such as geometry, font,
  438. foreground and background. See the X(1) man page for a description of
  439. the options. For color or grayscale displays \fIgnuplot\fP also honors 
  440. the following resources (shown here with default values):
  441. .sp
  442. .B  "gnuplot*textColor: black"
  443. .br 
  444. .B  "gnuplot*borderColor: black"
  445. .br 
  446. .B  "gnuplot*axisColor: black"
  447. .br 
  448. .B  "gnuplot*line1Color: red"
  449. .br 
  450. .B  "gnuplot*line2Color: green"
  451. .br 
  452. .B  "gnuplot*line3Color: blue"
  453. .br 
  454. .B  "gnuplot*line4Color: magenta"
  455. .br 
  456. .B  "gnuplot*line5Color: cyan"
  457. .br 
  458. .B  "gnuplot*line6Color: sienna"
  459. .br 
  460. .B  "gnuplot*line7Color: orange"
  461. .br 
  462. .B  "gnuplot*line8Color: coral"
  463. .br 
  464. .PP
  465. The size or aspect ratio of a plot may be changed by resizing the
  466. .I gnuplot
  467. window.
  468. .SH AUTHORS
  469. Thomas Williams, Pixar Corporation, 
  470. .br
  471. (pixar!info-gnuplot@sun.com)
  472. .br
  473. and Colin Kelley.
  474. .PP
  475. Additions for labelling by Russell Lang, Monash University, Australia.
  476. .br
  477. (rjl@monu1.cc.monash.edu.au)
  478. .br
  479. Further additions by David Kotz, Dartmouth College, New Hampshire, USA
  480. (formerly of Duke University, North Carolina, USA).  
  481. .br
  482. (David.Kotz@Dartmouth.edu)
  483. .br
  484. XX11 support by Ed Kubaitis, University of Illinois, USA.
  485. .SH BUGS
  486. The atan() function does not work correctly for complex arguments.
  487. .br
  488. The bessel functions do not work for complex arguments.
  489. .br
  490. See the 
  491. .I help bugs
  492. command in gnuplot.
  493. .SH SEE ALSO
  494. See the printed manual or the on-line help for details on specific commands.
  495. .br
  496. XX(1).
  497. SHAR_EOF
  498. chmod 0644 gnuplot/docs/gnuplot.1 ||
  499. echo 'restore of gnuplot/docs/gnuplot.1 failed'
  500. Wc_c="`wc -c < 'gnuplot/docs/gnuplot.1'`"
  501. test 3718 -eq "$Wc_c" ||
  502.     echo 'gnuplot/docs/gnuplot.1: original size 3718, current size' "$Wc_c"
  503. rm -f _shar_wnt_.tmp
  504. fi
  505. # ============= gnuplot/docs/gnuplot.doc ==============
  506. if test -f 'gnuplot/docs/gnuplot.doc' -a X"$1" != X"-c"; then
  507.     echo 'x - skipping gnuplot/docs/gnuplot.doc (File already exists)'
  508.     rm -f _shar_wnt_.tmp
  509. else
  510. > _shar_wnt_.tmp
  511. echo 'x - extracting gnuplot/docs/gnuplot.doc (Text)'
  512. sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/docs/gnuplot.doc' &&
  513. 1 gnuplot
  514. ?
  515. X GNUPLOT is a command-driven interactive function plotting program. It
  516. X is case sensitive (commands and function names written in lowercase
  517. X are not the same as those written in CAPS). All command names may be
  518. X abbreviated, as long as the abbreviation is not ambiguous. Any number
  519. X of commands may appear on a line, separated by semicolons (;).
  520. X Strings are indicated with quotes.  They may be either single or double
  521. X quotation marks, e.g.,
  522. X
  523. X          load "filename"
  524. X          cd 'dir'
  525. X Any command-line arguments are assumed to be names of files containing 
  526. X GNUPLOT commands, with the exception of standard X11 arguments, which
  527. X are processed first. Each file is loaded with the `load` command, in the
  528. X order specified. GNUPLOT exits after the last file is processed.  When
  529. X no load files are named, gnuplot enters into an interactive mode.
  530. X Commands may extend over several input lines, by ending each 
  531. X line but the last with a backslash (\). The backslash must be the LAST
  532. X character on each line. The effect is as if the backslash and newline
  533. X were not there. That is, no white space is implied, nor is a comment
  534. X terminated. Therefore, commenting out a continued line comments out
  535. X the entire command (see `comment`).
  536. X In this documentation, curly braces ({}) denote optional arguments to
  537. X many commands, and a vertical bar (|) separates mutually exclusive
  538. X choices.  GNUPLOT keywords or help topics are indicated by backquotes
  539. X or `boldface` (where available).  Angle brackets (<>) are used to mark
  540. X replaceable tokens.
  541. X For help on any topic, type `help` followed by the name of the topic.
  542. X
  543. X The new GNUPLOT user should begin by reading about the `plot`
  544. X command (type `help plot`).
  545. 2 cd
  546. ?cd
  547. X The `cd` command changes the working directory.
  548. X Syntax:
  549. X         cd "<directory-name>"
  550. X The directory name must be enclosed in quotes.
  551. X Examples:
  552. X         cd 'subdir'
  553. X         cd ".."
  554. 2 clear
  555. ?clear
  556. X The `clear` command erases the current screen or output device as
  557. X specified by `set output`. This usually generates a formfeed on
  558. X hardcopy devices. Use `set terminal` to set the device type.
  559. 2 command-line editing
  560. ?line-editing
  561. ?editing
  562. ?history
  563. X The Unix and IBM PC versions of GNUPLOT support command-line editing.
  564. X Also, a history mechanism allows previous commands to be edited, and
  565. X re-executed. After the command line has been edited, a newline or
  566. X carriage return will enter the entire line regardless of where the
  567. X cursor is positioned.
  568. X
  569. X The editing commands are as follows:
  570. @start table - first is interactive cleartext form
  571. X `Line editing`:
  572. X ^B moves back a single character.
  573. X ^F moves forward a single character.
  574. X ^A moves to the beginning of the line.
  575. X ^E moves to the end of the line.
  576. X ^H and DEL delete the previous character.
  577. X ^D deletes the current character.
  578. X ^K deletes from current position to the end of line.
  579. X ^L,^R redraws line in case it gets trashed.
  580. X ^U deletes the entire line.
  581. X ^W deletes the last word.
  582. X
  583. X `History`:
  584. X ^P moves back through history.
  585. X ^N moves forward through history.
  586. #Character && Function \\ \hline 
  587. #\multicolumn{3}{|c|}{Line Editing}\\
  588. #\verb~^B~ && move back a single character.\\
  589. #\verb~^F~ && move forward a single character.\\
  590. #\verb~^A~ && move to the beginning of the line.\\
  591. #\verb~^E~ && move to the end of the line.\\
  592. #\verb~^H, DEL~ && delete the previous character.\\
  593. #\verb~^D~ && delete the current character.\\
  594. #\verb~^K~ && delete from current position to the end of line.\\
  595. #\verb~^L, ^R~ && redraw line in case it gets trashed.\\
  596. #\verb~^U~ && delete the entire line. \\
  597. #\verb~^W~ && delete from the current word to the end of line. \\ \hline
  598. #\multicolumn{3}{|c|}{History} \\
  599. #\verb~^P~ && move back through history.\\
  600. #\verb~^N~ && move forward through history.\\
  601. %Character@@Function
  602. %_
  603. %@@Line Editing
  604. %^B@@move back a single character.
  605. %^F@@move forward a single character.
  606. %^A@@move to the beginning of the line.
  607. %^E@@move to the end of the line.
  608. %^H, DEL@@delete the previous character.
  609. %^D@@delete the current character.
  610. %^K@@delete from current position to the end of line.
  611. %^L, ^R@@redraw line in case it gets trashed.
  612. %^U@@delete the entire line.
  613. %^W@@delete from the current word to the end of line.
  614. %_
  615. %@@History
  616. %^P@@move back through history.
  617. %^N@@move forward through history.
  618. @end table 
  619. X
  620. X On the IBM PC the use of a TSR program such as DOSEDIT or CED may be
  621. X desired for line editing. For such a case GNUPLOT may be compiled with
  622. X no line editing capability (default makefile setup). Set READLINE in the
  623. X makefile and add readline.obj to the link file if GNUPLOT line editing
  624. X is to be used for the IBM PC. The following arrow keys may be used
  625. X on the IBM PC version if readline is used:
  626. @start table - first is interactive cleartext form
  627. X Left  Arrow     - same as ^B.
  628. X Right Arrow     - same as ^F.
  629. X Ctl Left  Arrow - same as ^A.
  630. X Ctl Right Arrow - same as ^E.
  631. X Up    Arrow     - same as ^P.
  632. X Down  Arrow     - same as ^N.
  633. #Arrow key & Function & \\ \hline 
  634. #Left      & same as \verb~^B~. & \\
  635. #Right     & same as \verb~^F~. & \\
  636. #Ctl Left  & same as \verb~^A~. & \\
  637. #Ctl Right & same as \verb~^E~. & \\
  638. #Up        & same as \verb~^P~. & \\
  639. #Down      & same as \verb~^N~. & \\
  640. %Arrow key@@Function
  641. %_
  642. %Left Arrow@@same as ^B.
  643. %Right Arrow@@same as ^F.
  644. %Ctl Left Arrow@@same as ^A.
  645. %Ctl Right Arrow@@same as ^E.
  646. %Up Arrow@@same as ^P.
  647. %Down Arrow@@same as ^N.
  648. %_
  649. @end table 
  650. 2 comment
  651. ?comments
  652. X Comments are supported as follows: a # may appear in most places in a line
  653. X and GNUPLOT will ignore the rest of the line. It will not have this
  654. X effect inside quotes, inside numbers (including complex numbers), inside
  655. X command substitutions, etc. In short, it works anywhere it makes sense
  656. X to work.
  657. 2 environment
  658. ?environment
  659. X A number of shell environment variables are understood by GNUPLOT.
  660. X None of these are required, but may be useful.
  661. X If GNUTERM is defined, it is used as the name of the terminal type to
  662. X be used. This overrides any terminal type sensed by GNUPLOT on start
  663. X up, but is itself overridden by the .gnuplot (or equivalent) start-up
  664. X file (see `start-up`), and of course by later explicit changes.
  665. X On Unix, AmigaDOS, and MS-DOS, GNUHELP may be defined to be the pathname
  666. X of the HELP file (gnuplot.gih).
  667. X
  668. X On VMS, the symbol GNUPLOT$HELP should be defined as the name of 
  669. X the help library for GNUPLOT.
  670. X On Unix, HOME is used as the name of a directory to search for 
  671. X a .gnuplot file if none is found in the current directory.
  672. X On AmigaDOS and MS-DOS, GNUPLOT is used. On VMS, SYS$LOGIN: is used.
  673. X See help start-up.
  674. X On Unix, PAGER is used as an output filter for help messages.
  675. X On Unix and AmigaDOS, SHELL is used for the `shell` command. On MS-DOS,
  676. X COMSPEC is used for the `shell` command.
  677. X
  678. X On AmigaDOS, GNUFONT is used for the screen font.  For example:
  679. X "setenv GNUFONT sapphire/14".
  680. X
  681. X On MS-DOS, if the BGI interface is used, the variable `BGI` is used to point 
  682. X to the full path to the BGI drivers directory. Furthermore SVGA is used to
  683. X name the Super VGA BGI driver in 800x600 res., and its mode of operation
  684. X as 'Name.Mode'.
  685. X For example, if the Super VGA driver is C:\TC\BGI\SVGADRV.BGI and mode 3 is
  686. X used for 800x600 res., then: 'set BGI=C:\TC\BGI' and 'set SVGA=SVGADRV.3'.
  687. 2 exit
  688. ?exit
  689. ?quit
  690. X The commands `exit` and `quit` and the END-OF-FILE character
  691. X will exit GNUPLOT. All these commands will clear the output device
  692. X (as the `clear` command does) before exiting.
  693. 2 expressions
  694. ?expressions
  695. X In general, any mathematical expression accepted by C, FORTRAN,
  696. X Pascal, or BASIC is valid. The precedence of these operators is
  697. X determined by the specifications of the C programming language.
  698. X White space (spaces and tabs) is ignored inside expressions.
  699. X Complex constants may be expressed as the {<real>,<imag>}, where <real>
  700. X and <imag> must be numerical constants. For example, {3,2}
  701. X represents 3 + 2i; {0,1} represents `i` itself. The curly braces 
  702. X are explicitly required here.
  703. 3 functions
  704. ?expressions functions
  705. ?functions
  706. X The functions in GNUPLOT are the same as the corresponding functions
  707. X in the Unix math library, except that all functions accept integer,
  708. X real, and complex arguments, unless otherwise noted. The `sgn`
  709. X function is also supported, as in BASIC.
  710. @start table
  711. #Function & Arguments & Returns \\ \hline
  712. %Function@Arguments@Returns
  713. %_
  714. 4 abs
  715. ?expressions functions abs
  716. ?functions abs
  717. ?abs
  718. #abs(x) & any  &  absolute value of {\tt x}, $|x|$; same type \\
  719. #abs(x) & complex &  length of {\tt x}, $\sqrt{{\mbox{real}(x)^{2} +
  720. #\mbox{imag}(x)^{2}}}$ \\
  721. %abs(x)@any@absolute value of x, $|x|$; same type 
  722. %abs(x)@complex@length of x, $sqrt{roman real (x) sup 2 + roman imag (x) sup 2}$ 
  723. X The `abs` function returns the absolute value of its argument. The
  724. X returned value is of the same type as the argument.
  725. X For complex arguments, abs(x) is defined as the length of x in the
  726. X complex plane [i.e.,  sqrt(real(x)**2 + imag(x)**2) ].
  727. 4 acos
  728. ?expressions functions acos
  729. ?functions acos
  730. ?acos
  731. #acos(x) & any  & $\cos^{-1} x$ (inverse cosine) in radians \\
  732. %acos(x)@any@$cos sup -1 x$ (inverse cosine) in radians 
  733. X The `acos` function returns the arc cosine (inverse cosine) of its
  734. X argument. `acos` returns its argument in radians.
  735. 4 arg
  736. ?expressions functions arg
  737. ?functions arg
  738. ?arg
  739. #arg(x) & complex & the phase of $x$ in radians\\
  740. %arg(x)@complex@the phase of $x$ in radians
  741. X The `arg` function returns the phase of a complex number, in radians.
  742. 4 asin
  743. ?expressions functions asin
  744. ?functions asin
  745. ?asin
  746. #asin(x) & any  & $\sin^{-1} x$ (inverse sin) in radians \\
  747. %asin(x)@any@$sin sup -1 x$ (inverse sin) in radians 
  748. X The `asin` function returns the arc sin (inverse sin) of its argument.
  749. X `asin` returns its argument in radians.
  750. 4 atan
  751. ?expressions functions atan
  752. ?functions atan
  753. ?atan
  754. #atan(x) & any  & $\tan^{-1} x$ (inverse tangent) in radians \\
  755. %atan(x)@any@$tan sup -1 x$ (inverse tangent) in radians 
  756. X The `atan` function returns the arc tangent (inverse tangent) of its
  757. X argument. `atan` returns its argument in radians.
  758. 4 besj0
  759. ?expressions functions besj0
  760. ?functions besj0
  761. ?besj0
  762. #besj0(x) & radians &  $j_{0}$ Bessel function of $x$ \\
  763. %besj0(x)@radians@$j sub 0$ Bessel function of $x$ 
  764. X The `besj0` function returns the j0th Bessel function of its argument.
  765. X `besj0` expects its argument to be in radians.
  766. 4 besj1
  767. ?expressions functions besj1
  768. ?functions besj1
  769. ?besj1
  770. #besj1(x) & radians & $j_{1}$ Bessel function of $x$ \\
  771. %besj1(x)@radians@$j sub 1$ Bessel function of $x$ 
  772. X The `besj1` function returns the j1st Bessel function of its argument.
  773. X `besj1` expects its argument to be in radians.
  774. 4 besy0
  775. ?expressions functions besy0
  776. ?functions besy0
  777. ?besy0
  778. #besy0(x) & radians & $y_{0}$ Bessel function of $x$ \\
  779. %besy0(x)@radians@$y sub 0$ Bessel function of $x$ 
  780. X The `besy0` function returns the y0th Bessel function of its argument.
  781. X `besy0` expects its argument to be in radians.
  782. 4 besy1
  783. ?expressions functions besy1
  784. ?functions besy1
  785. ?besy1
  786. #besy1(x) & radians & $y_{1}$ Bessel function of $x$ \\
  787. %besy1(x)@radians@$y sub 1$ Bessel function of $x$ 
  788. X The `besy1` function returns the y1st Bessel function of its argument.
  789. X `besy1` expects its argument to be in radians.
  790. 4 ceil
  791. ?expressions functions ceil
  792. ?functions ceil
  793. ?ceil
  794. #ceil(x) & any & $\lceil x \rceil$, smallest integer not less than $x$
  795. #(real part) \\
  796. %ceil(x)@any@$left ceiling x right ceiling$, smallest integer not less than $x$ (real part) 
  797. X The `ceil` function returns the smallest integer that is not less than its
  798. X argument. For complex numbers, `ceil` returns the smallest integer
  799. X not less than the real part of its argument.
  800. 4 cos
  801. ?expressions functions cos
  802. ?functions cos
  803. ?cos
  804. #cos(x) & radians & $\cos x$, cosine of $x$ \\
  805. %cos(x)@radians@$cos~x$, cosine of $x$ 
  806. X The `cos` function returns the cosine of its argument. `cos` expects its
  807. X argument to be in radians.
  808. 4 cosh
  809. ?expressions functions cosh
  810. ?functions cosh
  811. ?cosh
  812. #cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \\
  813. %cosh(x)@radians@$cosh~x$, hyperbolic cosine of $x$ 
  814. X The `cosh` function returns the hyperbolic cosine of its argument.
  815. X `cosh` expects its argument to be in radians.
  816. 4 exp
  817. ?expressions functions exp
  818. ?functions exp
  819. ?exp
  820. #exp(x) & any & $e^{x}$,  exponential function of $x$ \\
  821. %exp(x)@any@$e sup x$, exponential function of $x$ 
  822. X The `exp` function returns the exponential function of its argument
  823. X (`e` raised to the power of its argument).
  824. 4 floor
  825. ?expressions functions floor
  826. ?functions floor
  827. ?floor
  828. #floor(x) & any & $\lfloor x \rfloor$,  largest integer not greater
  829. #than $x$ (real part) \\
  830. %floor(x)@any@$left floor x right floor$, largest integer not greater than $x$ (real part) 
  831. X The `floor` function returns the largest integer not greater than its
  832. X argument. For complex numbers, `floor` returns the largest
  833. X integer not greater than the real part of its argument.
  834. 4 gamma
  835. ?expressions functions gamma
  836. ?functions gamma
  837. ?gamma
  838. #gamma(x) & any & $\Gamma(\mbox{real}(x))$,  gamma function of real($x$) \\
  839. %gamma(x)@any@$GAMMA ( roman real (x))$, gamma function of real ($x$)
  840. X The `gamma` function returns the gamma function of the real part of
  841. X its argument. For integer n, gamma(n+1) = n! .
  842. X If the argument is a complex value, the imaginary component is ignored.
  843. 4 imag
  844. ?expressions functions imag
  845. ?functions imag
  846. ?imag
  847. #imag(x) & complex &  imaginary part of $x$ as a real number \\
  848. %imag(x)@complex@imaginary part of $x$ as a real number 
  849. X The `imag` function returns the imaginary part of its argument as a
  850. X real number.
  851. 4 int
  852. ?expressions functions int
  853. ?functions int
  854. ?int
  855. #int(x) & real &  integer part of $x$, truncated toward zero \\
  856. %int(x)@real@integer part of $x,$ truncated toward zero 
  857. X The `int` function returns the integer part of its argument, truncated
  858. X toward zero.
  859. 4 log
  860. ?expressions functions log
  861. ?functions log
  862. ?log
  863. #log(x) & any & $\log_{e} x$,  natural logarithm (base $e$) of $x$ \\
  864. %log(x)@any@$ln~x$, natural logarithm (base $e$) of $x$ 
  865. X The `log` function returns the natural logarithm (base `e`) of its
  866. X argument.
  867. 4 log10
  868. ?expressions functions log10
  869. ?functions log10
  870. ?log10
  871. #log10(x) & any & $\log_{10} x$,  logarithm (base $10$) of $x$ \\
  872. %log10(x)@any@${log sub 10}~x$, logarithm (base $10$) of $x$ 
  873. X The `log10` function returns the logarithm (base 10) of its argument.
  874. 4 real
  875. ?expressions functions real
  876. ?functions real
  877. ?real
  878. #real(x) & any &  real part of $x$ \\
  879. %real(x)@any@real part of $x$ 
  880. X The `real` function returns the real part of its argument.
  881. 4 sgn
  882. ?expressions functions sgn
  883. ?functions sgn
  884. ?sgn
  885. #sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \\
  886. %sgn(x)@any@1 if $x > 0$, -1 if $x < 0$, 0 if $x = 0$. $roman imag (x)$ ignored 
  887. X The `sgn` function returns 1 if its argument is positive, -1 if its
  888. X argument is negative, and 0 if its argument is 0. If the argument
  889. X is a complex value, the imaginary component is ignored.
  890. 4 sin
  891. ?expressions functions sin
  892. ?functions sin
  893. ?sin
  894. #sin(x) & radians & $\sin x$, sine of $x$ \\
  895. %sin(x)@radians@$sin~x$, sine of $x$ 
  896. X The `sin` function returns the sine of its argument. `sin` expects its
  897. X argument to be in radians.
  898. 4 sinh
  899. ?expressions functions sinh
  900. ?functions sinh
  901. ?sinh
  902. #sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \\
  903. %sinh(x)@radians@$sinh~x$, hyperbolic sine $x$ 
  904. X The `sinh` function returns the hyperbolic sine of its argument. `sinh`
  905. X expects its argument to be in radians.
  906. 4 sqrt
  907. ?expressions functions sqrt
  908. ?functions sqrt
  909. ?sqrt
  910. #sqrt(x) & any & $\sqrt{x}$,  square root of $x$ \\
  911. %sqrt(x)@any@$sqrt x $, square root of $x$ 
  912. X The `sqrt` function returns the square root of its argument.
  913. 4 tan
  914. ?expressions functions tan
  915. ?functions tan
  916. ?tan
  917. #tan(x) & radians & $\tan x$,  tangent of $x$ \\
  918. %tan(x)@radians@$tan~x$, tangent of $x$ 
  919. X The `tan` function returns the tangent of its argument. `tan` expects
  920. X its argument to be in radians.
  921. 4 tanh
  922. ?expressions functions tanh
  923. ?functions tanh
  924. ?tanh
  925. #tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\\
  926. %tanh(x)@radians@$tanh~x$, hyperbolic tangent of $x$
  927. X The `tanh` function returns the hyperbolic tangent of its argument.
  928. X `tanh` expects its argument to be in radians.
  929. @end table
  930. 3 operators
  931. ?expressions operators
  932. ?operators
  933. X The operators in GNUPLOT are the same as the corresponding operators
  934. X in the C programming language, except that all operators accept
  935. X integer, real, and complex arguments, unless otherwise noted.
  936. X The ** operator (exponentiation) is supported, as in FORTRAN.
  937. X Parentheses may be used to change order of evaluation.
  938. 4 binary
  939. ?expressions operators binary
  940. ?operators binary
  941. ?binary
  942. X The following is a list of all the binary operators and their
  943. X usages:
  944. @start table - first is interactive cleartext form
  945. X  Symbol      Example      Explanation
  946. X   **          a**b          exponentiation
  947. X   *           a*b           multiplication
  948. X   /           a/b           division
  949. X   %           a%b         * modulo
  950. X   +           a+b           addition
  951. X   -           a-b           subtraction
  952. X   ==          a==b          equality
  953. X   !=          a!=b          inequality
  954. X   &           a&b         * bitwise AND
  955. X   ^           a^b         * bitwise exclusive OR
  956. X   |           a|b         * bitwise inclusive OR
  957. X   &&          a&&b        * logical AND
  958. X   ||          a||b        * logical OR
  959. X   ?:          a?b:c       * ternary operation
  960. #\multicolumn{3}{|c|}{Binary Operators} \\
  961. #Symbol & Example & Explanation \\ \hline
  962. #\verb~**~ & \verb~a**b~ & exponentiation\\
  963. #\verb~*~ & \verb~a*b~ & multiplication\\
  964. #\verb~/~ & \verb~a/b~ & division\\
  965. #\verb~%~ & \verb~a%b~ & * modulo\\
  966. #\verb~+~ & \verb~a+b~ & addition\\
  967. #\verb~-~ & \verb~a-b~ & subtraction\\
  968. #\verb~==~ & \verb~a==b~ & equality\\
  969. #\verb~!=~ & \verb~a!=b~ & inequality\\
  970. #\verb~&~ & \verb~a&b~ & * bitwise AND\\
  971. #\verb~^~ & \verb~a^b~ & * bitwise exclusive OR\\
  972. #\verb~|~ & \verb~a|b~ & * bitwise inclusive OR\\
  973. #\verb~&&~ & \verb~a&&b~ & * logical AND\\
  974. #\verb~||~ & \verb~a||b~ & * logical OR\\
  975. #\verb~?:~ & \verb~a?b:c~ & * ternary operation\\
  976. %Symbol@Example@Explanation
  977. %_
  978. %**@a**b@exponentiation
  979. %*@a*b@multiplication
  980. %/@a/b@division
  981. %%@a%b@* modulo
  982. %+@a+b@addition
  983. %-@a-b@subtraction
  984. %==@a==b@equality
  985. %!=@a!=b@inequality
  986. %&@a&b@* bitwise AND
  987. %^@a^b@* bitwise exclusive OR
  988. %|@a|b@* bitwise inclusive OR
  989. %&&@a&&b@* logical AND
  990. %||@a||b@* logical OR
  991. %?:@a?b:c@* ternary operation
  992. @end table 
  993. X (*) Starred explanations indicate that the operator requires
  994. X integer arguments.
  995. X Logical AND (&&) and OR (||) short-circuit the way they do in C.
  996. X That is, the second && operand is not evaluated if the first is
  997. X false; the second || operand is not evaluated if the first is true.
  998. X The ternary operator evaluates its first argument (a). If it is
  999. X true (non-zero) the second argument (b) is evaluated and returned,
  1000. X otherwise the third argument (c) is evaluated and returned.
  1001. 4 unary
  1002. ?expressions operators unary
  1003. ?operators unary
  1004. ?unary
  1005. X The following is a list of all the unary operators and their
  1006. X usages:
  1007. @start table - first is interactive cleartext form
  1008. X  Symbol     Example      Explanation
  1009. X   -           -a          unary minus
  1010. X   ~           ~a        * one's complement
  1011. X   !           !a        * logical negation
  1012. X   !           a!        * factorial
  1013. #\multicolumn{3}{|c|}{Unary Operators}\\
  1014. #Symbol & Example & Explanation \\ \hline
  1015. #\verb@-@ & \verb@-a@ & unary minus \\
  1016. #\verb@~@ & \verb@~a@ & * one's complement \\
  1017. #\verb@!@ & \verb@!a@ & * logical negation \\
  1018. #\verb@!@ & \verb@a!@ & * factorial \\
  1019. %-@-a@unary minus
  1020. %~@~a@* one's complement
  1021. %!@!a@* logical negation
  1022. %!@a!@* factorial
  1023. @end table 
  1024. X (*) Starred explanations indicate that the operator requires an
  1025. X integer argument.
  1026. X The factorial operator returns a real number to allow a greater range.
  1027. 2 help
  1028. ?help
  1029. X The `help` command displays on-line help. To specify information on a
  1030. X particular topic use the syntax:
  1031. X         help {<topic>}
  1032. X If <topic> is not specified, a short message is printed about
  1033. X GNUPLOT. After help for the requested topic is given, help for a
  1034. X subtopic may be requested by typing its name, extending the help
  1035. X request. After that subtopic has been printed, the request may be
  1036. X extended again, or simply pressing return goes back one level to the
  1037. X previous topic. Eventually, the GNUPLOT command line will return.
  1038. 2 load
  1039. ?load
  1040. X The `load` command executes each line of the specified input file as
  1041. X if it had been typed in interactively. Files created by the `save`
  1042. X command can later be `load`ed. Any text file containing valid
  1043. X commands can be created and then executed by the `load` command.
  1044. X Files being `load`ed may themselves contain `load` commands. See
  1045. X `comment` for information about comments in commands.
  1046. X The `load` command must be the last command on the line.
  1047. X Syntax:
  1048. X         load "<input-file>"
  1049. X The name of the input file must be enclosed in quotes.
  1050. X Examples:
  1051. X         load 'work.gnu'
  1052. X         load "func.dat"
  1053. X The `load` command is performed implicitly on any file names given as
  1054. X arguments to GNUPLOT. These are loaded in the order specified, and
  1055. X then GNUPLOT exits.
  1056. 2 pause
  1057. ?pause
  1058. X The `pause` command displays any text associated with the command and
  1059. X then waits a specified amount of time or until the carriage return is
  1060. X pressed.  `pause` is especially useful in conjunction with `load` files.
  1061. X
  1062. X Syntax:
  1063. X         pause <time> {"<string>"}
  1064. X
  1065. X <time> may be any integer constant or expression. Choosing -1 will
  1066. X wait until a carriage return is hit, zero (0) won't pause at all, and
  1067. X a positive integer will wait the specified number of seconds.
  1068. X Note: Since `pause` is not part of the plot it may interact with
  1069. X different device drivers differently (depending upon how text and
  1070. X graphics are mixed).
  1071. X Examples:
  1072. X         pause -1    # Wait until a carriage return is hit
  1073. X         pause 3     # Wait three seconds
  1074. X         pause -1  "Hit return to continue"
  1075. X         pause 10  "Isn't this pretty?  It's a cubic-spline."
  1076. 2 plot
  1077. ?plot
  1078. ?splot
  1079. X `plot` and `splot` are the primary commands of the program. They plot
  1080. X functions and data in many, many ways. `plot` is used to plot 2-d
  1081. X functions and data, while `splot` plots 3-d surfaces and data.
  1082. X
  1083. X Syntax:
  1084. X         plot {ranges}  <function> {title} {style}
  1085. X                     {, <function> {title} {style}...}
  1086. X         splot {ranges}  <function> {title} {style}
  1087. X                      {, <function> {title} {style}...}
  1088. X where <function> is either a mathematical expression, the name of a
  1089. X data file enclosed in quotes, or a pair (`plot`) or triple (`splot`)
  1090. X of mathematical expressions in the case of parametric functions.
  1091. X User-defined functions and variables may also be defined here.
  1092. X `plot` and `splot` commands can be as simple as
  1093. X         plot sin(x)
  1094. X and
  1095. X         splot x * y
  1096. X or as complex as (!)
  1097. X         plot [t=1:10] [-pi:pi*2] tan(t),"data.1" with lines,t**2 with points
  1098. 3 data-file
  1099. ?plot datafile
  1100. ?plot data-file
  1101. ?splot datafile
  1102. ?splot data-file
  1103. ?datafile
  1104. ?data-file
  1105. ?data
  1106. X Discrete data contained in a file can displayed by specifying the
  1107. X name of the data file (enclosed in quotes) on the `plot` or `splot`
  1108. X command line. Data files should contain one data point per line.
  1109. X Lines beginning with # (or ! on VMS) will be treated as comments
  1110. X and ignored. For `plot`s, each data point represents an (x,y)
  1111. X pair. For `splot`s, each point is an (x,y,z) triple. For `plot`s with
  1112. X error bars (see `plot errorbars`), each data point is either
  1113. X (x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
  1114. X line of a data file must be separated by blank space. This blank
  1115. X space divides each line into columns.
  1116. X
  1117. X For `plot`s the x value may be omitted, and for `splot`s the x
  1118. X and y values may be omitted. In either case the omitted values are
  1119. X assigned the current coordinate number. Coordinate numbers start at 0
  1120. X and are incremented for each data point read.
  1121. X
  1122. X To specify other formats, see `plot datafile using`.
  1123. X In the `plot` command, blank lines in the data file cause a break in
  1124. X the plot. There will be no line drawn between the preceding and
  1125. X following points if the plot style is `lines` or `linespoints` (see
  1126. X `plot style`). This does not change the plot style, as would plotting
  1127. X the data as separate curves.
  1128. X This example compares the data in the file population.dat to a
  1129. X theoretical curve:
  1130. X         pop(x) = 103*exp((1965-x)/10)
  1131. X         plot [1960:1990] 'population.dat', pop(x)
  1132. X The file population.dat might contain:
  1133. X         # Gnu population in Antarctica since 1965
  1134. X         1965   103
  1135. X         1970   55
  1136. X         1975   34
  1137. X         1980   24
  1138. X         1985   10
  1139. X When a data file is plotted, `samples` and `iso_samples` are ignored.
  1140. X Curves plotted using the `plot` command are automatically extended to
  1141. X hold the entire curve. Similarly grid data plotted using the `splot`
  1142. X command is automatically extended, using the assumption that isolines
  1143. X are separated by blank lines (a line with only a CR/LF in it).
  1144. X Implicitly, there are two types of 3-d datafiles. If all the isolines
  1145. X are of the same length, the data is assumed to be a grid data, i.e.,
  1146. X the data has a grid topology. Cross isolines in the other parametric
  1147. X direction (the ith cross isoline passes thru the ith point of all the
  1148. X provided isolines) will also be drawn for grid data. (Note contouring
  1149. X is available for grid data only.) If all the isolines are not of the
  1150. X same length, no cross isolines will be drawn and contouring that data
  1151. X is impossible.
  1152. X For splot if 3-d datafile and using format (see `splot datafile using`)
  1153. X specify only z (height field), a non parametric mode must be specified.
  1154. X If, on the other hand, x, y, and z are all specified, a parametric
  1155. X mode should be selected (see `set parametric`) since data is defining a
  1156. X parametric surface.
  1157. X
  1158. X A simple example of plotting a 3-d data file is
  1159. X         splot 'glass.dat'
  1160. X
  1161. X For more information about 3-d plotting, see `splot`.
  1162. 4 using
  1163. ?plot datafile using
  1164. ?plot data-file using
  1165. ?splot datafile using
  1166. ?splot data-file using
  1167. ?using
  1168. X The format of data within a file can be selected with the `using` 
  1169. X option. An explicit scanf string can be used, or simpler column
  1170. X choices can be made.
  1171. X Syntax:
  1172. X         plot "datafile" { using { <ycol> |
  1173. X                                   <xcol>:<ycol> |
  1174. X                                   <xcol>:<ycol>:<ydelta> |
  1175. X                                   <xcol>:<ycol>:<ylow>:<yhigh> }
  1176. X                                 {"<scanf string>"} } ...
  1177. X
  1178. X and
  1179. X
  1180. X         splot "datafile" { using { <xcol>:<ycol>:<zcol> | <zcol> }
  1181. X                                  {"<scanf string>"} } ...
  1182. X <xcol>, <ycol>, and <zcol> explicitly select the columns to plot from
  1183. X a space or tab separated multicolumn data file. If only <ycol> is
  1184. X selected for `plot`, <xcol> defaults to 1. If only <zcol> is selected
  1185. X for `splot`, then only that column is read from the file. An <xcol> of
  1186. X 0 forces <ycol> to be plotted versus its coordinate number. <xcol>,
  1187. X <ycol>, and <zcol> can be entered as constants or expressions.
  1188. X
  1189. X If errorbars (see also `plot errorbars`) are used for `plot`s,
  1190. X ydelta (for example, a +/- error) should be provided as the third
  1191. X column, or ylow and yhigh as third and fourth columns.  These columns
  1192. X must follow the x and y columns.
  1193. X
  1194. X Scanf strings override any <xcol>:<ycol>(:<zcol>) choices, except for
  1195. X ordering of input, e.g.,
  1196. X         plot "datafile" using 2:1 "%f%*f%f"
  1197. X causes the first column to be y and the third column to be x.
  1198. X
  1199. X If the scanf string is omitted, the default is generated based on the
  1200. X <xcol>:<ycol>(:<zcol>) choices. If the `using` option is omitted, "%f%f"
  1201. X is used for `plot` ("%f%f%f%f" for `errorbar` `plot`s) and "%f%f%f" is
  1202. X used for `splot`.
  1203. X Examples:
  1204. X         plot "MyData" using "%*f%f%*20[^\n]%f" with lines
  1205. X
  1206. X Data are read from the file "MyData" using the format
  1207. X "%*f%f%*20[^\n]%f". The meaning of this format is: "%*f" ignore the
  1208. X first number, "%f" then read in the second and assign to x,
  1209. X "%*20[^\n]" then ignore 20 non-newline characters, "%f" then read in
  1210. X the y value.
  1211. X
  1212. X         n=3;
  1213. X         plot "MyData", "MyData" using n 
  1214. X
  1215. X causes GNUPLOT to plot the second and third columns of MyData versus
  1216. X the first column. The command 'n=4; replot' would then plot the second
  1217. X and fourth columns of MyData versus the first column.
  1218. X         splot "glass.dat" using 1
  1219. X
  1220. X causes GNUPLOT to plot the first coordinate of the points of glass.dat
  1221. X as the z coordinate while ignoring the other two coordinates.
  1222. X Note: GNUPLOT first reads a line of the data file into a buffer and 
  1223. X then does a 
  1224. X         sscanf(input_buffer, scanf_string, &x, &y{, &z});
  1225. X where 'x', 'y', and 'z' are of type 'float'. Any scanf string that
  1226. X specifies two (three for `splot`, three or four for `errorbars`) float
  1227. X numbers may be used.
  1228. 3 errorbars
  1229. ?plot errorbars
  1230. ?errorbars
  1231. X Error bars are supported for 2-d data file plots by reading one or
  1232. X two additional columns specifying ydelta or ylow and yhigh
  1233. X respectively. No support exists for x error bars or any error bars
  1234. X for `splot`s.
  1235. X
  1236. X In the default situation, GNUPLOT expects to see three or four
  1237. X numbers on each line of the data file, either (x, y, ydelta) or 
  1238. X (x, y, ylow, yhigh). The x coordinate must be specified. The order
  1239. X of the numbers must be exactly as given above. Data files in this
  1240. X format can easily be plotted with error bars:
  1241. X
  1242. X         plot "data.dat" with errorbars
  1243. X
  1244. X The error bar is a vertical line plotted from (x, ylow) to (x,
  1245. X yhigh). If ydelta is specified instead of ylow and yhigh, 
  1246. X ylow=y-ydelta and yhigh=y+ydelta are derived. If there
  1247. X are only two numbers on the line, yhigh and ylow are both set to
  1248. X y. To get lines plotted between the data points, `plot` the
  1249. X data file twice, once with errorbars and once with lines.
  1250. X
  1251. X If y autoscaling is on, the y range will be adjusted to fit the
  1252. X error bars.
  1253. X
  1254. X The `using` option may be used to specify how columns of the data file
  1255. X are to be assigned to x, y, ydelta, ylow, and yhigh. The x column must
  1256. X be provided and both the x and y columns must appear before the
  1257. X errorbar columns. If three column numbers are given, they are x, y,
  1258. X and ydelta. If four columns are given, they are x, y, ylow, and
  1259. X yhigh.
  1260. X
  1261. X Examples:
  1262. X         plot "data.dat" using 1:2:3:4 with errorbars
  1263. X         plot "data.dat" using 3:2:6 with errorbars
  1264. X         plot "data.dat" using 3:4:8:7 with errorbars
  1265. X The first example reads, x, y, ylow, and yhigh, from columns 1, 2, 3,
  1266. X and 4. This is equivalent to the default.  The second example reads x
  1267. X from the third column, y from second and ydelta from the sixth column.
  1268. X The third example reads x from the third column, y from the fourth,
  1269. X ylow from the eighth, and yhigh from seventh columns.
  1270. X See also `plot using` and `plot style`.
  1271. 3 parametric
  1272. ?plot parametric
  1273. ?splot parametric
  1274. ?parametric
  1275. X When in parametric mode (`set parametric`) mathematical expressions must
  1276. X be given in pairs for `plot` and in triplets for `splot`:
  1277. X         plot sin(t),t**2
  1278. X or
  1279. X         splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
  1280. X Data files are plotted as before, except any preceding parametric
  1281. X function must be fully specified before a data file is given as a
  1282. X plot. In other words, the x parametric function (sin(t) above) and
  1283. X the y parametric function (t**2 above) must not be interrupted with
  1284. X any modifiers or data functions; doing so will generate a syntax error
  1285. X stating that the parametric function is not fully specified.
  1286. X Ranges take on a different meaning when in parametric mode. The first
  1287. X range on the `plot` command is the `trange`, the next is the `xrange`,
  1288. X and the last is the `yrange`. For `splot` the order is `urange`,
  1289. X `vrange`, `xrange`, `yrange`, and finally `zrange`. The following
  1290. X `plot` command shows setting the `trange` to [-pi:pi], the `xrange` to
  1291. X [-1.3:1.3] and the `yrange` to [-1:1] for the duration of the plot:
  1292. X         plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
  1293. X Other modifiers, such as `with` and `title`, may be specified only
  1294. X after the parametric function has been completed:
  1295. X         plot sin(t),t**2 title 'Parametric example' with linespoints
  1296. 3 ranges
  1297. ?splot ranges
  1298. ?plot ranges
  1299. ?ranges
  1300. X The optional range specifies the region of the plot that will be
  1301. X displayed.
  1302. X Ranges may be provided on the `plot` and `splot` command line and
  1303. X affect only that plot, or in the `set xrange`, `set yrange`, etc.,
  1304. X commands, to change the default ranges for future plots.
  1305. X Syntax:
  1306. X         [{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }
  1307. X where <dummy-var> is the independent variable (the defaults are x and
  1308. X y, but this may be changed with `set dummy`) and the min and max
  1309. X terms can be constant expressions.
  1310. X Both the min and max terms are optional. The ':' is also optional
  1311. X if neither a min nor a max term is specified. This allows '[ ]' to
  1312. X be used as a null range specification.
  1313. X Specifying a range in the `plot` command line turns autoscaling for
  1314. X that axis off for that plot. Using one of the `set` range commands
  1315. X turns autoscaling off for that axis for future plots, unless changed
  1316. X later. (See `set autoscale`).
  1317. X Examples:
  1318. X This uses the current ranges:
  1319. X         plot cos(x)
  1320. X This sets the x range only:
  1321. X         plot [-10:30] sin(pi*x)/(pi*x)
  1322. X This is the same, but uses t as the dummy-variable:
  1323. X         plot [t = -10 :30]  sin(pi*t)/(pi*t)
  1324. X This sets both the x and y ranges:
  1325. X         plot [-pi:pi] [-3:3]  tan(x), 1/x
  1326. X This sets only the y range, and turns off autoscaling on both axes:
  1327. X         plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
  1328. X This sets xmax and ymin only:
  1329. X         plot [:200] [-pi:]  exp(sin(x))
  1330. X This sets the x, y, and z ranges:
  1331. X         splot [0:3] [1:4] [-1:1] x*y
  1332. 3 style
  1333. ?plot style
  1334. ?splot style
  1335. ?style
  1336. ?plot with
  1337. ?with
  1338. X Plots may be displayed in one of six styles: `lines`, `points`,
  1339. X `linespoints`, `impulses`, `dots`, or `errorbars`. The `lines` style
  1340. X connects adjacent points with lines. The `points` style displays a
  1341. X small symbol at each point. The `linespoints` style does both
  1342. X `lines` and `points`. The `impulses` style displays a vertical line
  1343. X from the x axis (or from the grid base for `splot`) to each point. The
  1344. X `dots` style plots a tiny dot at each point; this is useful for
  1345. X scatter plots with many points.
  1346. X
  1347. X The `errorbars` style is only relevant to 2-d data file plotting. It
  1348. X is treated like `points` for `splot`s and function `plot`s. For data
  1349. X `plot`s, `errorbars` is like `points`, except that a vertical error 
  1350. X bar is also drawn: for each point (x,y), a line is drawn from
  1351. X (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
  1352. X bar. The ylow and yhigh values are read from the data file's columns,
  1353. X as specified with the `using` option to plot. See `plot errorbars` for
  1354. X more information.
  1355. X Default styles are chosen with the `set function style` and
  1356. X `set data style` commands.
  1357. X By default, each function and data file will use a different 
  1358. X line type and point type, up to the maximum number of available 
  1359. X types. All terminal drivers support at least six different point
  1360. X types, and re-use them, in order, if more than six are required.
  1361. X The LaTeX driver supplies an additional six point types (all variants
  1362. X of a circle), and thus will only repeat after twelve curves are
  1363. X plotted with points.
  1364. X If desired, the style and (optionally) the line type and point type
  1365. X used for a curve can be specified.
  1366. X
  1367. X Syntax:
  1368. X         with <style> {<linetype> {<pointtype>}}
  1369. X where <style> is either `lines`, `points`, `linespoints`, `impulses`,
  1370. SHAR_EOF
  1371. true || echo 'restore of gnuplot/docs/gnuplot.doc failed'
  1372. fi
  1373. echo 'End of  part 8'
  1374. echo 'File gnuplot/docs/gnuplot.doc is continued in part 9'
  1375. echo 9 > _shar_seq_.tmp
  1376. exit 0
  1377.  
  1378. exit 0 # Just in case...
  1379. -- 
  1380. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1381. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1382. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1383. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1384.