# Plot 2-D data point in just one plan

everyone!

I have got a little problem trying to draw in LaTeX.

Let me try to explain: I have a xyz-axis, as you can see on the figure below.

Plotting any 2-D data point graph in the xy-axis:

\begin{filecontents}{data.dat}
0 0
1 1
2 4
\end{filecontents}

\begin{document}

\begin{tikzpicture}[scale=1]

\draw[thick,->,black] (0,0,0) -- (2,0,0) node[anchor=west]{$x$};
\draw[thick,->] (0,0,0) -- (0,4.5,0) node[anchor=east]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=east]{$z$};

\draw[smooth] plot file {data.dat};

\end{tikzpicture}


Resulting:

The problem is: I cannot plot a similar graph just in the zy-axis.

Any idea how to do it?

Thanks a lot!

-

This solution uses tikzlibrary 3d which makes it easier to draw 2d datum with 3d coordinates.

Code:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usepackage{filecontents}
\usetikzlibrary{3d}

\begin{document}

\begin{filecontents}{data.dat}
0 0
1 1
2 4
\end{filecontents}

\begin{tikzpicture}
\draw[thick,->,black] (0,0,0) -- (2,0,0) node[anchor=west]{$x$};
\draw[thick,->] (0,0,0) -- (0,4.5,0) node[anchor=east]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,2) node[anchor=east]{$z$};
\begin{scope}[canvas is xy plane at z=0]
\draw [smooth] plot file {data.dat};
\end{scope}
\begin{scope}[canvas is xz plane at y=0]
\draw [smooth] plot file {data.dat};
\end{scope}
\begin{scope}[canvas is yz plane at x=0]
\draw [smooth] plot file {data.dat};
\end{scope}
\end{tikzpicture}
\end{document}

-
Perfect, @Jesse ! It was exactly what I needed! Thank you very much! – user44331 Jan 18 '14 at 20:27