home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / gnuplot1.10A / part06 / docs / gnuplot.hlp < prev    next >
Encoding:
Text File  |  1989-09-09  |  19.2 KB  |  583 lines

  1.  
  2.  GNUPLOT is a command-driven interactive function plotting program.  It
  3.  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.  Any number
  6.  of commands may appear on a line, separated by semicolons (;).
  7.  
  8.  Type the EOF character (^D for UNIX, ^Z for DOS) to exit the help system
  9.  from any level and return to GNUPLOT.  <RETURN> goes back to the previous
  10.  level and to GNUPLOT from top level help.
  11. 1 clear
  12.  This command erases the current screen or output device as specified
  13.  by 'set output'.  This usually generates a formfeed on hardcopy
  14.  devices.  Use 'set terminal' to set the device type.
  15. 1 exit
  16.  'exit', 'quit' and your computer's END-OF-FILE character will exit
  17.  GNUPLOT.  All these commands will clear the output device (as the
  18.  'clear' command does) before exiting.
  19. 1 expressions
  20. 2 functions
  21. 3 abs
  22.  This function returns the absolute value of its argument.  The
  23.  returned value is of the same type as the argument.
  24.  
  25.  For complex arguments, abs(x) is defined as the length of x in the
  26.  complex plane [i.e.  sqrt(real(x)**2 + imag(x)**2) ].
  27. 3 acos
  28.  This function returns the arc cosine (inverse cosine) of its
  29.  argument.  'acos' returns its argument in radians.
  30. 3 arg
  31.  This function returns the phase of a complex number, in radians.
  32. 3 asin
  33.  This function returns the arc sin (inverse sin) of its argument.
  34.  'asin' returns its argument in radians.
  35. 3 atan
  36.  This function returns the arc tangent (inverse tangent) of its
  37.  argument.  'atan' returns its argument in radians.
  38. 3 besj0
  39.  This function returns the j0th Bessel function of its argument.
  40.  'besj0' expects its argument to be in radians.
  41. 3 besj1
  42.  This function returns the j1st Bessel function of its argument.
  43.  'besj1' expects its argument to be in radians.
  44. 3 besy0
  45.  This function returns the y0th Bessel function of its argument.
  46.  'besy0' expects its argument to be in radians.
  47. 3 besy1
  48.  This function returns the y1st Bessel function of its argument.
  49.  'besy1' expects its argument to be in radians.
  50. 3 ceil
  51.  This function returns the largest integer not less than its
  52.  argument.  For complex numbers, 'ceil' returns the largest integer
  53.  not less than the real part of its argument.
  54. 3 cos
  55.  This function returns the cosine of its argument.  'cos' expects its
  56.  argument to be in radians.
  57. 3 cosh
  58.  This function returns the hyperbolic cosine of its argument.
  59.  'cosh' expects its argument to be in radians.
  60. 3 exp
  61.  This function returns the exponential function of its argument
  62.  (e raised to the power of its argument).
  63. 3 floor
  64.  This function returns the smallest integer not greater than its
  65.  argument.  For complex numbers, 'floor' returns the smallest
  66.  integer not greater than the real part of its argument.
  67. 3 imag
  68.  This function returns the imaginary part of its argument as a real number.
  69. 3 int
  70.  This function returns the integer part of its argument, truncated
  71.  toward zero.
  72. 3 log
  73.  This function returns the natural logarithm (base e) of its
  74.  argument.
  75. 3 log10
  76.  This function returns the logarithm (base 10) of its argument.
  77. 3 real
  78.  This function returns the real part of its argument.
  79. 3 sgn
  80.  This function returns 1 if its argument is positive, -1 if its
  81.  argument is negative, and 0 if its argument is 0.  If the argument
  82.  is a complex value, the imaginary component is ignored.
  83. 3 sin
  84.  This function returns the sine of its argument.  'sin' expects its
  85.  argument to be in radians.
  86. 3 sinh
  87.  This function returns the hyperbolic sine of its argument.  'sinh'
  88.  expects its argument to be in radians.
  89. 3 sqrt
  90.  This function returns the square root of its argument.
  91. 3 tan
  92.  This function returns the tangent of its argument.  'tan' expects
  93.  its argument to be in radians.
  94. 3 tanh
  95.  This function returns the hyperbolic tangent of its argument.
  96.  'tanh' expects its argument to be in radians.
  97. 2 operators
  98. 3 binary
  99.  The following is a list of all the binary operators and their
  100.  usages:
  101.  
  102.   Symbol     Example      Explanation
  103.    **          a**b          exponentiation
  104.    *           a*b           multiplication
  105.    /           a/b           division
  106.    %           a%b         * modulo
  107.    +           a+b           addition
  108.    -           a-b           subtraction
  109.    ==          a==b          equality
  110.    !=          a!=b          inequality
  111.    &           a&b         * bitwise and
  112.    ^           a^b         * bitwise exclusive or
  113.    |           a|b         * bitwise inclusive or
  114.    &&          a&&b        * logical and
  115.    ||          a||b        * logical or
  116.    ?:          a?b:c       * ternary operation
  117.  
  118.  (*) Starred explanations indicate that the operator requires
  119.  integer arguments.
  120.  
  121.  Logical AND (&&) and OR (||) short-circuit the way they do in C.
  122.  That is, the second && operand is not evaluated if the first is
  123.  false; the second || operand is not evaluated if the first is true.
  124.  
  125.  The ternary operator evaluates its first argument (a).  If it is
  126.  true (non-zero) the second argument (b) is evaluated and returned,
  127.  otherwise the third argument (c) is evaluated and returned.
  128. 3 unary
  129.  The following is a list of all the unary operators and their
  130.  usages:
  131.  
  132.   Symbol     Example      Explanation
  133.    -           -a            unary minus
  134.    ~           ~a          * one's complement
  135.    !           !a          * logical negation
  136.    !           a!          * factorial
  137.  
  138.  (*) Starred explanations indicate that the operator requires an
  139.  integer argument.
  140.  
  141.  The factorial operator returns a real number to allow a greater range.
  142. 1 help
  143.  The 'help' command displays on-line help.  To specify information on a
  144.  particular topic use the syntax:
  145.  
  146.      help <topic>
  147.  
  148.  Help is actually a separate program.  If help doesn't work for you, ask
  149.  your administrator how to set up the GNUHELP environment variable (and
  150.  possibly the HELPDIR environment variable).
  151.  
  152.  You may exit the help utility and return to GNUPLOT by either pressing
  153.  <Return>(s) at the 'HELP >' prompt or pressing your computer's END-OF-FILE
  154.  character at any help prompt.
  155. 1 load
  156.  This command executes each line of the specified input file as if it
  157.  had been typed in interactively.  Files created by the 'save' command
  158.  can later be 'load'ed.  Any text file containing valid commands can be
  159.  created and then executed by the 'load' command.  Files being 'load'ed
  160.  may themselves contain 'load' commands.  Lines beginning with # (or !
  161.  if using VMS) will be treated as comments and ignored.
  162.  
  163.  The 'load' command must be the last command on the line.
  164.  
  165.  Syntax:
  166.          load <input-file>
  167.  
  168.  The name of the input file must be enclosed in quotes.
  169.  
  170.  Examples:
  171.  
  172.          load 'work.gnu'
  173.          load "func.dat"
  174. 1 pause
  175.  Pause is useful in conjunction with `load` files.  The command 'pause'
  176.  displays any text associated with the command and then waits the
  177.  specified amount of time.  This allows one to build a 'load' file
  178.  and control the amount of time a finished graph is displayed.  The
  179.  first argument is an expression that can be -1, 0, 1, 2, ...  -1
  180.  will wait until a carriage return is hit.  0 won't pause at all, and
  181.  1, 2, etc. will wait the specified number of seconds.
  182.  
  183.  Note: Since pause is not part of the plot it may interact with
  184.  different device drivers differently (depending upon how text and
  185.  graphics are mixed).
  186.  
  187.  Examples:
  188.          pause -1    ! Wait until a carriage return is hit
  189.          pause 3     ! Wait three seconds
  190.          pause -1  "Hit return to continue"
  191.          pause 10  "Isn't this pretty?  It's a cubic-spline."
  192.  
  193.  Syntax:
  194.          pause <expression> ["string"]
  195. 1 plot
  196. 2 data_file
  197.  Discrete data contained in a file can displayed by specifying the
  198.  name of the data file (enclosed in quotes) on the 'plot' command
  199.  line.
  200.  
  201.  Data files should contain one data point per line.  A data point may
  202.  be specified either as an X and Y value separated by blank space, or
  203.  as just the Y value, in which case the program will use the number
  204.  of the coordinate as the X value.  Coordinate numbers starts at 0
  205.  and are incremented for each data point read.  Blank lines and lines
  206.  beginning with # will be treated as comments and ignored.
  207.  
  208.  
  209.  This example compares the data in the file population.dat to a
  210.  theoretical curve:
  211.  
  212.          pop(x) = 103*exp((1965-x)/10)
  213.          plot [1960:1990] 'population.dat', pop(x)
  214.  
  215.  The file population.dat might contain:
  216.  
  217.   # Gnu population in Antarctica since 1965
  218.   1965   103
  219.   1970   55
  220.   1975   34
  221.   1980   24
  222.   1985   10
  223. 2 ranges
  224.  This option specifies the region of the plot which will be displayed.
  225.  
  226.  Ranges may be provided on the 'plot' command line as synonyms for
  227.  the 'set xrange' and 'set yrange' commands.
  228.  
  229.  Syntax:
  230.          [{dummy-var =} {xmin : xmax}] { [{ymin : ymax}] }
  231.  
  232.  Where dummy-var is the independent variable (the default is 'x',
  233.  but this may be changed with the 'set dummy' command) and the min
  234.  and max terms can be expressions or constants.
  235.  
  236.  Both the min and max terms are optional.  The ':' is also optional
  237.  if neither a min nor a max term is specified.  This allows '[]' to
  238.  be used as a null range specification.
  239.  
  240.  Specifying a Y range turns autoscaling OFF.
  241.  
  242.  
  243.  Examples:
  244.  
  245.  This uses current ranges:
  246.          plot cos(x)
  247.  
  248.  This sets the xrange only:
  249.          plot [-10:30] sin(pi*x)/(pi*x)
  250.  
  251.  This is the same, but uses t as the dummy-variable:
  252.          plot [t = -10 :30]  sin(pi*t)/(pi*t)
  253.  
  254.  This sets both the x and yranges:
  255.          plot [-pi:pi] [-3:3]  tan(x), 1/x
  256.  
  257.  This sets only the yrange:
  258.          plot [] [-2:sin(5)*-8] sin(x)**besj0(x)
  259.  
  260.  This sets xmax and ymin only:
  261.          plot [:200] [-pi:]  exp(sin(x))
  262. 2 style
  263.  Plots may be displayed in one of three styles: 'lines', 'points', or
  264.  'impulses'.  The 'lines' style connects adjacent points with lines.
  265.  The 'points' style displays a small symbol at each point.  The
  266.  'impulses' style displays a vertical line from the X axis to each
  267.  point.
  268.  
  269.  Default styles are chosen with the 'set function style' and
  270.  'set data style' commands.
  271.  
  272.  Syntax:
  273.          with <style>
  274.  
  275.  Where <style> is one of 'lines', 'points', or 'impulses'.  These
  276.  keywords may be abbreviated.
  277.  
  278.  
  279.  Examples:
  280.  
  281.  This plots sin(x) with impulses:
  282.          plot sin(x) with impulses
  283.  
  284.  This plots sin(x) with points, cos(x) default:
  285.          plot [-9:30]  sin(x) w points, cos(x)
  286.  
  287.  This plots tan(x) with the default function style, "data.1" with lines:
  288.          plot [] [-2:5] tan(x), "data.1" with l
  289.  
  290.  This plots "leastsq.dat" with impulses:
  291.          plot 'leastsq.dat' w i
  292. 1 print
  293.  This command prints the value of <expression> to the screen.
  294.  
  295.  Syntax:
  296.          print <expression>
  297.  
  298.  See 'expressions'.
  299. 1 quit
  300.  'quit' is a synonym for 'exit'.  See 'exit'.
  301. 1 replot
  302.  'replot' repeats the last 'plot' command.  This can be useful for
  303.  viewing a plot with different 'set' options, or when generating the
  304.  same plot for several devices.
  305. 1 save
  306.  This command saves either user-defined functions, variables, or both
  307.  to the specified file.
  308.  
  309.  Syntax:
  310.          save  {option} <filename>
  311.  
  312.  Where <option> is either 'functions' or 'variables'.  If no option is
  313.  used GNUPLOT saves both functions and variables.
  314.  
  315.  'save'd files are written in text format and may be read by the 'load'
  316.  command.
  317.  
  318.  The filename must be enclosed in quotes.
  319.  
  320.  Examples:
  321.  
  322.          save "work.gnu"
  323.          save functions 'func.dat'
  324.          save var 'var.dat'
  325. 1 set-show
  326.  Set or show various internal gnuplot settings.
  327. 2 all
  328.  The command 'show all' will display all the set-show options
  329.  currently in effect.
  330.  
  331.  Syntax:
  332.          show all
  333. 2 autoscale
  334.  If autoscaling is set, the Y axis is automatically scaled to fit the
  335.  range of the function or data being plotted.  If autoscaling is not
  336.  set, the current Y range is used.  See 'set yrange'.
  337.  
  338.  Syntax:
  339.          set autoscale
  340.          set noautoscale
  341.          show autoscale
  342. 2 dummy
  343.  By default, GNUPLOT assumes that the independent variable is 'x' on
  344.  the 'plot' command line.  'x' is called the dummy variable because
  345.  it is just a notation to indicate the independent variable.  The
  346.  'set dummy' command changes this default dummy variable name.  For
  347.  example, you may find it more convenient to call the dummy variable
  348.  't' when plotting time functions:
  349.  
  350.          set dummy t
  351.          plot sin(t), cos(t)
  352.  
  353.  Syntax:
  354.          set dummy <dummy-var>
  355.          show dummy
  356. 2 functions
  357.  The 'show functions' command lists all user-defined functions and
  358.  their definitions.
  359.  
  360.  Syntax:
  361.          show functions
  362. 2 logscale
  363.  Log scaling may be set on the X and/or Y axis.
  364.  
  365.  Syntax:
  366.          set logscale <axes>
  367.          set nologscale
  368.          show logscale
  369.  
  370.  Where <axes> is either 'x', 'y', or 'xy'.
  371. 2 polar
  372.  The 'set polar' command changes the meaning of the plot from
  373.  rectangular coordinates to polar coordinates.  In polar
  374.  coordinates, the dummy variable (x) is an angle.  The domain
  375.  of this angle is changed from whatever it was to [0:2*pi].
  376.  
  377.  The command 'set nopolar' changes the meaning of the plot back
  378.  to the default rectangular coordinate system.  The domain of
  379.  x is changed from whatever it was to [-10:10].
  380.  
  381.  While in polar coordinates the meaning of an expression in x
  382.  is really r = f(x), where x is an angle of rotation.  The plot,
  383.  however, is plotted on a rectangular grid.  Thus the displayed
  384.  ranges of x and y are rectanglar values, while the command
  385.  'set xrange' refers to polar values.
  386.  
  387.  Syntax:
  388.          set polar
  389.       set nopolar
  390.       show polar
  391. 2 offsets
  392.  The amount of the graph that the plot takes up may be controlled
  393.  to some extent with the 'set offsets' command.  This command takes
  394.  four arguments--left offset, right offset, top offset and bottom
  395.  offset.  By default, each offset is 0.  Left and right offsets are
  396.  given in units of the x axis, while top and bottom offsets are
  397.  given in units of the y axis.  The plot of sin(x), displayed with
  398.  offsets of 0, 0, 2, 2 will take up  1/3 of the displayed y axis.
  399.  Offsets are particularly useful with polar coordinates as a means
  400.  of compensating for aspect ratio distortion.
  401.  
  402.  Syntax:
  403.          set offsets <expr>, <expr>, <expr>, <expr>
  404.          show offsets
  405. 2 output
  406.  By default, plots are displayed to the standard output.  The
  407.  'set output' command redirects the displays to the specified file or
  408.  device.
  409.  
  410.  Syntax:
  411.          set output {filename}
  412.          show output
  413.  
  414.  The filename must be enclosed in quotes.  If the filename is
  415.  omitted, output will be sent to the standard output.
  416. 2 samples
  417.  The sampling rate of functions may be changed by the 'set samples'
  418.  command.  By default, sampling is set to 160 points.  A higher
  419.  sampling rate will produce more accurate plots, but will take
  420.  longer.  In generating plots, GNUPLOT will use either the sampling
  421.  rate set or the resolution of the current output device, whichever
  422.  is lower.
  423.  
  424.  Syntax:
  425.          set samples <expression>
  426.          show samples
  427. 2 style
  428.  Plots may be displayed in one of three styles: 'lines', 'points', or
  429.  'impulses'.  The 'lines' style connects adjacent points with lines.
  430.  The 'points' style displays a small symbol at each point.  The
  431.  'impulses' style displays a vertical line from the X axis to each
  432.  point.
  433.  
  434.  Default styles are chosen with the 'set function style' and 'set
  435.  data style' commands.  See 'plot' for information about how to
  436.  override the default plotting style for individual functions.
  437.  
  438.  Syntax:
  439.          set function style <style>
  440.          set data style <style>
  441.          show function style
  442.          show data style
  443.  
  444.  Where style is either 'lines', 'points', or 'impulses'.
  445. 2 terminal
  446.  GNUPLOT supports many different graphics devices.  Use the 'set
  447.  terminal' command to select the type of device for which GNUPLOT
  448.  will produce output.   While your installation may not include all
  449.  of these, the following were available in the source code at the
  450.  time this help file was written:
  451.  
  452.  Machines:  IBM-PC's (ega, cga, hercules), ATT6300, CORONA325,
  453.             UNIXPC (att7300 or 3b1);
  454.  Terminals: AED512, AED767, HP2623A, HP7580B, REGIS, SELENAR,
  455.             TEK40xx, BBN Bitgraph;
  456.  Printers:  LASERJET1, LASERJET2, LASERJET3, POSTSCRIPT, QMS,
  457.             VECTRIX384;
  458.  Other:     UNIXPLOT.
  459.  
  460.  Syntax:
  461.          set terminal {terminal-type}
  462.          show terminal
  463.  
  464.  If <terminal-type> is omitted, GNUPLOT will list the available
  465.  terminal types.  <terminal-type> may be abbreviated.
  466.  
  467.  Use 'set output' to redirect this output to a file or device.
  468. 2 variables
  469.  The 'show variables' command lists all user-defined variables and
  470.  their values.
  471.  
  472.  Syntax:
  473.          show variables
  474. 2 version
  475.  Show the current version of gnuplot.  This is the same text
  476.  that appears when gnuplot starts up.  (There is no SET VERSION
  477.  command, of course.)
  478.  
  479.  Syntax:
  480.      SHOW VERSION
  481. 2 xrange
  482.  The 'set xrange' command sets the horizontal range which will be
  483.  displayed.
  484.  
  485.  This range may also be specified on the 'plot' command line.
  486.  
  487.  Syntax:
  488.          set xrange [{xmin : xmax}]
  489.  
  490.  Where <xmin> and <xmax> terms are expressions or constants.
  491.  
  492.  Both the <xmin> and <xmax> terms are optional.
  493. 2 yrange
  494.  The 'set yrange' command sets the vertical range which will be
  495.  displayed.  This command turns autoscaling OFF.
  496.  
  497.  This range may also be specified on the 'plot' command line.
  498.  
  499.  Syntax:
  500.          set yrange [{ymin : ymax}]
  501.  
  502.  Where <ymin> and <ymax> terms are expressions or constants.
  503.  
  504.  Both the <ymin> and <ymax> terms are optional.
  505. 2 zero
  506.  GNUPLOT will not plot a point if its imaginary part is greater in
  507.  magnitude than the 'zero' threshold.  The default 'zero' value is
  508.  1e-8.
  509.  
  510.  Syntax:
  511.          set zero <expression>
  512.          show zero
  513. 1 shell
  514.  The 'shell' command spawns an interactive shell.  To return to
  515.  GNUPLOT, type 'logout' if using VMS, 'exit' or your END-OF-FILE
  516.  character if using Unix, or 'exit' if using MS-DOS.
  517.  
  518.  A single shell command may be spawned by preceding it with the !
  519.  character ($ if using VMS) at the beginning of a command line.
  520.  Control will return immediately to GNUPLOT after this command is
  521.  executed.  For example,
  522.  
  523.       ! dir
  524.  
  525.  prints a directory listing and then returns to GNUPLOT.
  526. 1 start_up
  527.  When GNUPLOT is run, it looks for an initialization file to load.
  528.  This file is called '.gnuplot' on Unix systems, and 'GNUPLOT.INI' on
  529.  other systems.  If this file is not found in the current directory,
  530.  the program will look for it in your home directory (under MS-DOS, the
  531.  environment variable GNUPLOT should contain the name of this
  532.  directory).
  533.  
  534.  If this file is found, GNUPLOT executes the commands in this file.
  535.  This is most useful for setting your terminal type and defining any
  536.  functions or variables which you use often.  The variable 'pi' is
  537.  already defined for you.
  538. 1 substitution
  539.  Command-line substitution is specified by a system command enclosed in
  540.  backquotes (`).  This command is spawned and the output it produces
  541.  replaces the name of the command (and backquotes) on the command line.
  542.  
  543.  Newlines in the output produced by the spawned command are replaced with
  544.  blanks.
  545.  
  546.  Command-line substitution can be used anywhere on the GNUPLOT command
  547.  line.
  548.  
  549.  
  550.  Example:
  551.  
  552.  This will run the program 'leastsq' and substitute `leastsq` on the
  553.  command line with its output:
  554.  
  555.   f(x) = `leastsq`
  556.  
  557.  or, in VMS
  558.  
  559.   f(x) = `run leastsq`
  560. 1 user_defined
  561.  You may define your own functions and variables.  User-defined
  562.  functions and variables may be used anywhere.
  563.  
  564.  User-defined function syntax:
  565.      <function-name> ( <dummy-var> ) =  <expression>
  566.  
  567.  Where <expression> is defined in terms of <dummy-var>.
  568.  
  569.  User-defined variable syntax:
  570.      <variable-name> = <constant-expression>
  571.  
  572.  Examples:
  573.      w = 2
  574.      q = floor(tan(pi/2 - 0.1))
  575.      f(x) = sin(w*x)
  576.      sinc(x) = sin(pi*x)/(pi*x)
  577.      delta(t) = (t == 0)
  578.      ramp(t) = (t > 0) ? t : 0
  579.  
  580.  The variable 'pi' is already defined for you.
  581.  
  582.  See 'show functions' and 'show variables'.
  583.