Go to the first, previous, next, last section, table of contents.


2.10 plot

section 2.10 plot is the primary command for drawing plots with `gnuplot`. It creates plots of functions and data in many, many ways. section 2.10 plot is used to draw 2-d functions and data; `splot` draws 2-d projections of 3-d surfaces and data. section 2.10 plot and `splot` contain many common features; see `splot` for differences. Note specifically that `splot`'s section 2.20.1.1 binary and section 2.20.1.3 matrix options do not exist for section 2.10 plot.

Syntax:

      plot {<ranges>}
           {<function> | {"<datafile>" {datafile-modifiers}}}
           {axes <axes>} {<title-spec>} {with <style>}
           {, {definitions,} <function> ...}

where either a <function> or the name of a data file enclosed in quotes is supplied. A function is a mathematical expression or a pair of mathematical expressions in parametric mode. The expressions may be defined completely or in part earlier in the stream of `gnuplot` commands (see `user-defined`).

It is also possible to define functions and parameters on the section 2.10 plot command itself. This is done merely by isolating them from other items with commas.

There are four possible sets of axes available; the keyword <axes> is used to select the axes for which a particular line should be scaled. `x1y1` refers to the axes on the bottom and left; `x2y2` to those on the top and right; `x1y2` to those on the bottom and right; and `x2y1` to those on the top and left. Ranges specified on the section 2.10 plot command apply only to the first set of axes (bottom left).

Examples:

      plot sin(x)
      plot f(x) = sin(x*a), a = .2, f(x), a = .4, f(x)
      plot [t=1:10] [-pi:pi*2] tan(t), \
           "data.1" using (tan($2)):($3/$4) smooth csplines \
                    axes x1y2 notitle with lines 5


Go to the first, previous, next, last section, table of contents.