# pgfplots: How to swap x- and y-axis changing the default (addplot3)?

Aiming to change x- and y-axis, I read some threads here and realize, that I could do the trick
({t},{t^2-5},{t+1}) ---> ({t^2-5},{t},{t+1});
then I have to 'rename' every setting for x and y.

But I ask myself: Is there a possibility to do that change, overwriting the default?

\documentclass[tikz, margin=5pt]{standalone}
\usepackage{amsmath, amssymb}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}[]
\begin{axis}[
scale=1.5,
ymin=-3,  ymax=7,
xmin=-30,  xmax=100,
axis lines=middle,
y dir=reverse,
y label style={at={(ticklabel* cs:-0.00)}, inner sep=5pt, anchor=south},
xlabel={$x$},
ylabel={$y$},
zlabel={$z$},
]
domain=-3:5,
samples=111, smooth,
samples y=0,
variable=\t,
]({t},{t^2-5},{t+1});
\end{axis}
\end{tikzpicture}

\end{document}


You can use the view key to rotate the coordinate system (the following rotates by 90 degrees around the z-axis from the default orientation, effectively swapping the x- and y-axis):

\documentclass[tikz, margin=5pt]{standalone}
\usepackage{amsmath, amssymb}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}[]
\begin{axis}[
scale=1.5,
ymin=-3,  ymax=7,
xmin=-30,  xmax=100,
axis lines=middle,
y dir=reverse,
y label style={at={(ticklabel* cs:-0.00)}, inner sep=5pt, anchor=south},
xlabel={$x$},
ylabel={$y$},
zlabel={$z$},
view={-65}{30},
]