home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / gnuplot.zip / GNUPLOT.HLP < prev    next >
Text File  |  1986-12-04  |  16KB  |  437 lines

  1. %% 0 gnuplot
  2. GNUPLOT is a command-driven interactive function plotting program.
  3. It is case sensitive (commands and function names written in lowercase
  4. are not the same as those written in CAPS).  All command names may be
  5. abbreviated, as long as the abbreviation is not ambiguous.
  6. %% 1 save
  7. This command saves either user-defined functions, variables, or both
  8. to the specified file.
  9.  
  10. Syntax:       save  {option} <filename>
  11.  
  12. Where <option> is either 'functions' or 'variables'.  If no option
  13. is used GNUPLOT saves both functions and variables.
  14.  
  15. 'save'd files are written in text format and may be read by the
  16. 'load' command.
  17.  
  18. The filename must be enclose in quotes.
  19. %% 1 print
  20. This command prints the value of <expression>.
  21.  
  22. Syntax:  print <expression>
  23.  
  24. See 'expressions'.
  25. %% 1 plot
  26. The 'plot' primary command of the program.  It displays functions
  27. and data in many, many ways.  The full syntax of this command is:
  28.  
  29.   plot {ranges}      <function> {style} {, <function> {style}...}
  30.  
  31. Where <function> is either a mathematical expression or the name of a
  32. data file enclosed in quotes.  User-defined functions and variables may also
  33. be defined here.
  34.  
  35. Curly braces {,} denote optional items.
  36.  
  37. A 'plot' command can be as simple as
  38.  
  39.    plot sin(x)
  40.  
  41. or as complex as (!)
  42.  
  43.    plot [t=1:100] [-pi:pi*2] tan(t), "data.1" with lines, besj0(t) with points
  44. %% 2 style
  45. Plots may be displayed in one of three styles:    'lines', 'points', or
  46. 'impulses'.  The 'lines' style connects adjacent points with lines.  The
  47. 'points' style displays a small symbol at each point.  The 'impulses' style
  48. displays a vertical line from the X axis to each point.
  49.  
  50. Default styles are chosen with the 'set function style' and 'set data style'
  51. commands.
  52.  
  53. Syntax:  with <style>
  54.  
  55. Where <style> is one of 'lines', 'points', or 'impulses'.  These keywords
  56. may be abbreviated.
  57.  
  58. Examples:                   Displays:
  59. plot sin(x) with impulses           ; sin(x) with impulses
  60. plot [-9:30]  sin(x) w points, cos(x)  ; sin(x) with points, cos(x) default
  61. plot [] [-2:5] tan(x), "data.1" with l ; tan(x) default, "data.1" with lines
  62. plot "leastsq.dat" w i               ; "leastsq.dat" with impulses
  63. %% 2 ranges
  64. These two options specify the region of the plot which will be displayed.
  65.  
  66. Ranges may be provided on the 'plot' command line as synonyms for the
  67. 'set xrange' and 'set yrange' commands.
  68.  
  69. Syntax:  [{dummy-var =} {xmin : xmax}] { [{ymin : ymax}] }
  70.  
  71. Where dummy-var is the independent variable ('x' is used by default) and
  72. the min and max terms can be expressions or constants.
  73.  
  74. Both the min and max terms are optional.  The ':' is also optional if
  75. neither a min nor a max term is specified.  This allows '[]' to be used
  76. as a null range specification.
  77.  
  78. Specifying a Y range turns autoscaling OFF.
  79.  
  80. Examples:
  81.  
  82. plot cos(x)                ; use current ranges
  83. plot [-10:30] sin(pi*x)/(pi*x)        ; set xrange only
  84. plot [t = -10 :30]  sin(pi*t)/(pi*t)    ; same, but use t as dummy-var
  85. plot [-pi:pi] [-3:3]  tan(x), 1/x    ; set y and xranges
  86. plot [] [-2:sin(5)*-8] sin(x)**besj0(x) ; set only yrange
  87. plot [:200] [-pi:]  exp(sin(x))        ; set xmax and ymin only
  88. %% 2 data_file
  89. Discrete data contained in a file can displayed by specifying the
  90. name of the data file (enclosed in quotes) on the 'plot' command line.
  91.  
  92. Data files should contain one data point per line.  A data point may be
  93. specified either as an X and Y value separated by blank space, or as
  94. just the Y value, in which case the program will use the number of the
  95. coordinate as the X value.  Coordinate numbers starts at 0 and are
  96. incremented for each data point read.  Blank lines and lines beginning
  97. with ! or # will be treated as comments and ignored.
  98.  
  99.  
  100. This example compares the data in the file population.dat to a theoretical
  101. curve:
  102.       pop(x) = 103*exp((1965-x)/10)
  103.       plot [1960:1990] 'population.dat', pop(x)
  104.  
  105. The file population.dat might contain:
  106.  
  107. ! Gnu population in Antarctica since 1965
  108. 1965   103
  109. 1970   55
  110. 1975   34
  111. 1980   24
  112. 1985   10
  113. %% 1 shell
  114. The 'shell' command spawns an interactive shell.  To return to GNUPLOT,
  115. type 'logout' if using VMS, 'exit' or your END-OF-FILE character if
  116. using Unix, or 'exit' if using MS-DOS.
  117.  
  118. A single shell command may be spawned by preceding it with the ! character
  119. at the beginning of a command line.  Control will return immediately to
  120. GNUPLOT after this command is executed.  For example,
  121.  
  122.     ! dir
  123.  
  124. prints a directory listing and then returns to GNUPLOT.
  125.  
  126. $ is accepted as a synonym for ! in VMS.
  127. %% 1 clear
  128. This command erases the current screen or output device as specified by
  129. 'set output'.  This usually generates a formfeed on hardcopy devices.
  130. Use 'set terminal' to set the device type.
  131. %% 1 load
  132. This command executes each line of the specified input file
  133. as if it had been typed in interactively.  Files created by the 'save'
  134. command can later be 'load'ed.    Any text file containing valid commands
  135. can be created and then executed by the 'load' command.  Files being
  136. 'load'ed may themselves contain 'load' commands.
  137.  
  138. The 'load' command must be the last command on the line.
  139.  
  140. Syntax:        load <input-file>
  141.  
  142. The name of the input file must be enclosed in quotes.
  143. %% 1 exit
  144. 'exit', 'quit' and your computer's END-OF-FILE character will
  145. exit GNUPLOT.  All these commands will clear the output device
  146. (as the 'clear' command does) before exiting.
  147. %% 1 quit
  148. 'quit' is a synonym for 'exit'.  See 'exit'.
  149. %% 1 expressions
  150. In general, any mathematical expression accepted by C, FORTRAN, Pascal, or
  151. BASIC is valid.  The precedence of these operators is determined by the
  152. specifications of the C programming language.  White space (spaces and tabs)
  153. is ignored inside expressions.
  154.  
  155. Complex constants may be expressed as the {real,imag}, where <real> and
  156. <imag> must be numerical constants.  For example {3,2} represents 3 + 2i;
  157. {0,1} represents 'i' itself.
  158. %% 2 functions
  159. The functions in GNUPLOT are the same as the corresponding functions
  160. in the UNIX math library, except that all functions accept integer, real,
  161. and complex arguments, unless otherwise noted.    The BASIC sgn() function
  162. is also supported.
  163. %% 3 real
  164. This function returns the real part of its argument.
  165. %% 3 imag
  166. This function returns the imaginary part of its argument as a real number.
  167. %% 3 arg
  168. This function returns the phase of a complex number, in radians.
  169. %% 3 sin
  170. This function returns the sine of its argument.  'sin' expects its argument
  171. to be in radians.
  172. %% 3 cos
  173. This function returns the cosine of its argument.  'cos' expects its argument
  174. to be in radians.
  175. %% 3 tan
  176. This function returns the tangent of its argument.  'tan' expects its argument
  177. to be in radians.
  178. %% 3 asin
  179. This function returns the arc sin (inverse sin) of its argument.  'asin'
  180. returns its argument in radians.
  181. %% 3 acos
  182. This function returns the arc cosine (inverse cosine) of its argument.    'acos'
  183. returns its argument in radians.
  184. %% 3 atan
  185. This function returns the arc tangent (inverse tangent) of its argument.
  186. 'atan' returns its argument in radians.
  187. %% 3 sinh
  188. This function returns the hyperbolic sine of its argument.  'sinh' expects
  189. its argument to be in radians.
  190. %% 3 cosh
  191. This function returns the hyperbolic cosine of its argument.  'cosh' expects
  192. its argument to be in radians.
  193. %% 3 tanh
  194. This function returns the hyperbolic tangent of its argument.  'tanh' expects
  195. its argument to be in radians.
  196. %% 3 int
  197. This function returns the integer part of its argument, truncated toward
  198. zero.
  199. %% 3 abs
  200. This function returns the absolute value of its argument.
  201. The returned value is of the same type as the argument.
  202.  
  203. For complex arguments, abs(x) is defined as the length of x in the
  204. complex plane [i.e.  sqrt(real(arg)**2 + imag(arg)**2) ].
  205. %% 3 sgn
  206. This function returns 1 if its argument is positive, -1 if its
  207. argument is negative, and 0 if its argument is 0.  If the argument
  208. is a complex value, the imaginary component is ignored.
  209. %% 3 sqrt
  210. This function returns the square root of its argument.
  211. %% 3 exp
  212. This function returns the exponential function of its argument (e raised to
  213. the power of its argument).
  214. %% 3 log
  215. This function returns the natural logarithm (base e) of its argument.
  216. %% 3 log10
  217. This function returns the logarithm (base 10) of its argument.
  218. %% 3 besj0
  219. This function returns the j0th Bessel function of its argument.  'besj0'
  220. expects its argument to be in radians.
  221. %% 3 besj1
  222. This function returns the j1st Bessel function of its argument.  'besj1'
  223. expects its argument to be in radians.
  224. %% 3 besy0
  225. This function returns the y0th Bessel function of its argument.  'besy0'
  226. expects its argument to be in radians.
  227. %% 3 besy1
  228. This function returns the y1st Bessel function of its argument.  'besy1'
  229. expects its argument to be in radians.
  230. %% 3 floor
  231. This function returns the smallest integer not greater than its argument.
  232. For complex numbers, 'floor' returns the smallest integer not greater than
  233. the real part of its argument.
  234. %% 3 ceil
  235. This function returns the largest integer not less than its argument.
  236. For complex numbers, 'ceil' returns the largest integer not less than
  237. the real part of its argument.
  238. %% 2 operators
  239. The operators in GNUPLOT are the same as the corresponding operators
  240. in the C programming language, except that all operators accept integer, real,
  241. and complex arguments, unless otherwise noted.    The FORTRAN **
  242. (exponentiation) operator is also supported.
  243.  
  244. Parentheses may be used to change order of evaluation.
  245. %% 3 binary
  246. The following is a list of all the binary operators and their usage:
  247.  
  248. Symbol        Example    Explantion
  249. **        a**b    exponentiation
  250. *        a*b        multiplication
  251. /        a/b        division
  252. %        a%b        modulo
  253. +        a+b        addition
  254. -        a-b        subtraction
  255. ==        a==b    equality
  256. !=        a!=b    inequality
  257. &        a&b        bitwise and
  258. ^        a^b        bitwise exclusive or
  259. |        a|b        bitwise inclusive or
  260. &&        a&&b    logical and
  261. ||        a||b    logical or
  262. ?:        a?b:c    terniary operation
  263.  
  264. The terniary operator evaluates its first argument (a).  If it is true
  265. (non-zero) the second argument (b) is returned, otherwise the
  266. third argument (c) is returned.
  267. %% 3 unary
  268. The following is a list of all the unary operators and their usage:
  269.  
  270. Symbol        Example    Explantion
  271. -        -a        unary minus
  272. ~        ~a        one's complement
  273. !        !a        logical negation
  274. %% 1 start_up
  275. When GNUPLOT is run, it looks for an initialization file to execute.
  276. This file is called '.gnuplot' on Unix systems, and 'GNUPLOT.INI' on
  277. other systems.    If this file is not found in the current directory,
  278. the program will look for it in your home directory (under MS-DOS,
  279. the environment variable GNUPLOT should contain the name of this directory).
  280.  
  281. If this file is found, GNUPLOT executes the commands in this file.  This
  282. is most useful for setting your terminal type and defining any functions or
  283. variables which you use often.    The variable 'pi' is already defined for
  284. you.
  285. %% 1 user_defined
  286. You may define your own functions and variables.  User-defined functions and
  287. variables may be used anywhere.
  288.  
  289. User-defined function syntax:
  290.     <function-name> ( <dummy-var> ) =  <expression>
  291.  
  292. Where <expression> is defined in terms of <dummy-var>.
  293.  
  294. User-defined variable syntax:
  295.     <variable-name> = <constant-expression>
  296.  
  297. Examples:
  298.     w = 2
  299.     q = floor(tan(pi/2 - 0.1))
  300.     f(x) = sin(w*x)
  301.     sinc(x) = sin(pi*x)/(pi*x)
  302.     delta(t) = (t == 0)
  303.     ramp(t) = (t > 0) ? t : 0
  304.  
  305. The variable 'pi' is already defined for you.
  306.  
  307. See 'show functions' and 'show variables'.
  308. %% 1 set-show
  309. The 'set' command sets LOTS of options.
  310.  
  311. The 'show' command shows their settings.  'show all' shows all the settings.
  312. %% 2 autoscale
  313. If autoscaling is set, the Y axis is automatically scaled to fit the range
  314. of the function or data being plotted.    If autoscaling is not set, the
  315. current Y range is used.  See 'set yrange'.
  316.  
  317. Syntax:  set autoscale
  318.      set noautoscale
  319.      show autoscale
  320. %% 2 output
  321. By default, plots are displayed to the standard output.  The 'set output'
  322. command redirects the displays to the specified file or device.
  323.  
  324. Syntax:  set output {filename}
  325.      show output
  326.  
  327. The filename must be enclosed in quotes.  If the filename is omitted, output
  328. will be sent to the standard output.
  329. %% 2 style
  330. Plots may be displayed in one of three styles:    'lines', 'points', or
  331. 'impulses'.  The 'lines' style connects adjacent points with lines.  The
  332. 'points' style displays a small symbol at each point.  The 'impulses' style
  333. displays a vertical line from the X axis to each point.
  334.  
  335. Default styles are chosen with the 'set function style' and 'set data style'
  336. commands.
  337.  
  338. Syntax:  set function style <style>
  339.      set data style <style>
  340.      show function style
  341.      show data style
  342.  
  343. Where style is either 'lines', 'points', or 'impulses'.
  344. %% 2 logscale
  345. Log scaling may be set on the X and/or Y axis.
  346.  
  347. Syntax:  set logscale <axes>
  348.      set nologscale
  349.      show logscale
  350.  
  351. Where <axes> is either 'x', 'y', or 'xy'.
  352. %% 2 variables
  353. The 'show variables' command lists all user-defined variables and their
  354. values.
  355.  
  356. Syntax:  show variables
  357. %% 2 functions
  358. The 'show functions' command lists all user-defined functions and their
  359. definitions.
  360.  
  361. Syntax:  show functions
  362. %% 2 samples
  363. The sampling rates of functions may be changed by the 'set samples'
  364. command.  By default, sampling is set to 160 points.  A higher sampling
  365. rate will produce more accurate plots, but will take longer.  In generating
  366. plots, GNUPLOT will use either the sampling rate set or the resolution of
  367. the current output device, whichever is smaller.
  368.  
  369. Syntax:  set samples <expression>
  370.      show samples
  371. %% 2 terminal
  372. GNUPLOT supports many different graphics devices.  Use the 'set terminal'
  373. command to select the type of device for which GNUPLOT will produce output.
  374.  
  375. Syntax:  set terminal {terminal-type}
  376.      show terminal
  377.  
  378. If <terminal-type> is omitted, the program will list the available terminal
  379. types.    <terminal-type> may be abbreviated.
  380.  
  381. Use 'set output' to redirect this output to a file or device.
  382. %% 2 zero
  383. GNUPLOT will not display points when their imaginary parts are greater
  384. than the 'zero' threshold.  The default 'zero' value is 1e-8.
  385.  
  386. Syntax:  set zero <expression>
  387.      show zero
  388. %% 2 xrange
  389. The 'set xrange' command sets the horizontal range of values which will
  390. be displayed.
  391.  
  392. This range may also be specified on the 'plot' command line.
  393.  
  394. Syntax:  set xrange [{xmin : xmax}]
  395.  
  396. Where <xmin> and <xmax> terms are expressions or constants.
  397.  
  398. Both the <xmin> and <xmax> terms are optional.
  399. %% 2 yrange
  400. The 'set yrange' command sets the vertical range of values which will
  401. be displayed.  This command turns autoscaling OFF.
  402.  
  403. This range may also be specified on the 'plot' command line.
  404.  
  405. Syntax:  set yrange [{ymin : ymax}]
  406.  
  407. Where <ymin> and <ymax> terms are expressions or constants.
  408.  
  409. Both the <ymin> and <ymax> terms are optional.
  410. %% 1 help
  411. The 'help' command will display on-line help.  To specify information
  412. on a particular topic use the syntax:
  413.  
  414.     help <topic>
  415.  
  416. You may exit the help utility and return to the plot program
  417. by either pressing <return> at the 'Topic?' prompt or pressing your
  418. computer's END-OF-FILE character at any help prompt.
  419. %% 1 substitution
  420. Command-line substitution is specified by a system command encolsed in
  421. backquotes (``).   This command is spawned and the output it produces
  422. replaces the name of the command (and backquotes) on the command line.
  423.  
  424. Newlines in the output produced by the spawned command are replaced with
  425. blanks.
  426.  
  427. Command-line substitution can be used anywhere on the GNUPLOT command line.
  428.  
  429.  
  430.  
  431. Examples:
  432.  
  433. a(x) = `leastsq`          ; substitutes "`leastsq`" with output
  434.             produced by a program named leastsq.
  435. a(x) = `run leastsq.exe`      ; same but for VMS.
  436. %%
  437.