# How to orientate a pgfplot 3D plot

I am trying to plot a spiral such that it is orientated as shown in the rough sketch. The spiral is coming out of the screen.

The script below yields the diagram shown at the end, but whatever I do I cannot seem to get the orientations as shown above. Looking at the pgfplot manual am I correct in thinking that I can only rotate about the z axis and vertically up and down? Any suggestions?

\begin{tikzpicture}
\begin{axis}[view={60}{30},
axis lines=center,axis on top,
zmin=0, zmax=8,
xmin=-2,xmax=2,
ymin=-2,ymax=2,
width=6cm,height=6cm]
({sin(deg(x))},
{cos(deg(x))},
{2*x/(5*pi)});
\end{axis}
\end{tikzpicture}


-

You need to change the parametrization so that you're using:

{2*x/(5*pi)},
{sin(deg(x))},
{cos(deg(x))}


which brings the spiral along the x axis.

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[tikz]{standalone}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[view={60}{30},
axis lines=center,axis on top,
zmin=-2, zmax=2,
xmin=-2,xmax=8,
ymin=-2,ymax=2,
width=6cm,height=6cm]
(
{2*x/(5*pi)},
{sin(deg(x))},
{cos(deg(x))}
);
\end{axis}
\end{tikzpicture}
\end{document}


Just for demonstration, here's the 'other' orientation (along the y axis)

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[tikz]{standalone}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[view={60}{30},
axis lines=center,axis on top,
zmin=-2, zmax=2,
xmin=-2,xmax=2,
ymin=-2,ymax=8,
width=6cm,height=6cm]
(
{sin(deg(x))},
{2*x/(5*pi)},
{cos(deg(x))}
);
\end{axis}
\end{tikzpicture}
\end{document}

-
Never occurred to me to do that. It obviously works and I am using it. –  rhody Feb 23 at 1:37