1.14 Three-dimensional plotting

Three-dimensional graphs may be produced by placing the modifier 3d immediately after the plot command, as demonstrated by the following simple example which draws a helix:

\includegraphics[width=10cm]{examples/eps/ex_3d_ helix}

Many plot styles take additional columns of data when used on three-dimensional plots, reading in three values for the $$x$, $y$ and $z$ coordinates of each datapoint, where previously only $x$ and $y$ coordinates were required. In the above example, the {\tt lines} plot style is used, which takes three columns of input data when used on three-dimensional plots, as compared to two on two-dimensional plots. The descriptions of each plot style in Section~ \ref{sec:list_ of_ plotstyles} includes information on the number of columns of data required for two- and three-dimensional plots. 

The example above also demonstrates that the {\tt set size} command\index{set size command@{\tt set size} command} takes an additional aspect ratio {\tt zratio} which affects three-dimensional plots; whereas the aspect ratio {\tt ratio} determines the ratio of the lengths of the 

$y$-axes of plots to their $x$-axes, the aspect ratio {\tt zratio} determines the ratio of the lengths of the $z$-axes of plots to their $x$-axes. 

The angle from which three-dimensional plots are viewed can be set using the {\tt set view} command\index{set view command@{\tt set view} command}. This should be followed by two angles, which can either be expressed in degrees, as dimensionless numbers, or as quantities with physical units of angle: 

\begin{verbatim} 
set view 60,30

set unit angle nodimensionless
set view unit(0.1*rev),unit(2*rad)
\end{verbatim}

 The orientation 

$(0,0)$ corresponds to having the $x$-axis horizontal, the $z$-axis vertical, and the $y$-axis directed into the page. The first angle supplied to the {\tt set view} command rotates the plot in the $(x,y)$ plane, and the second angle tips the plot up in the plane containing the $z$-axis and the normal to the user’s two-dimensional display. 

The {\tt replot} command\index{replot command@{\tt replot} command} command may be used to add additional datasets to three-dimensional plots in an entirely analogous fashion to two-dimensional plots. 

$