1.42 plot

plot [ 3d ] [ item <id> ] [ { <range> } ]
     ( <filename> | { <expression> } | { <vector obj> } )
     [ axes <axes>] [ every { <expression> } ]
     [ index <value>] [ select <expression> ]
     [ label <string expression> ]
     [ title <string> ] [ using { <expression> } ]
     [ with { <option> } ]

The plot command is used to produce graphs. The following simple example would plot the sine function:

plot sin(x)

Ranges for the axes of a graph can be specified by placing them in square brackets before the name of the function to be plotted. An example of this syntax would be:

plot [-pi:pi] sin(x)

which would plot the function $$(x)$ between $$ and $π$. 

Data files may also be plotted as well as functions, in which case the filename of the data file\  to be plotted should be enclosed in either single or double quotation marks. An example of this syntax would be: 

\begin{verbatim} 
plot 'data.dat' with points
\end{verbatim}

\noindent which would plot data from the file {\tt data.dat}. Section~ \ref{sec:plot_ datafiles} provides further details of the format that input data files should take and how Pyxplot may be directed to plot only certain portions of data files. 

Multiple datasets can be plotted on a single graph by specifying them in a comma-separated list, as in the example: 

\begin{verbatim} 
plot sin(x) with color blue, cos(x) with linetype 2
\end{verbatim}

If the {\tt 3d} modifier is supplied to the {\tt plot} command, then a three-dimensional plot is produced; many plot styles then take additional columns of data to signify the positions of datapoints along the 

$z$-axis. This is described further in Chapter~ \ref{ch:plotting}. The angle from which three-dimensional plots are viewed can be set using the {\tt set view} command. 

$