# rectangle in 3d plane

I am trying to plot a 3d axis with a rectangle perpendicular to the x-plane using the following code:

\documentclass[tikz]{standalone}
\usepackage{pgfplots,pgfplotstable}
\usetikzlibrary{calc}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view = {-40}{20},
zmin=10^5,
ymax=305,
area plot/.style={
fill opacity=0.75,
draw=black!50!black,
fill=blue!50,
mark=none,
},
xlabel={x},
ylabel={t },
zlabel={y}
]
\draw [red, thick,rounded corners] (axis cs:6.3,1,10^5) rectangle (axis cs:6.3,100,1.2*10^5);
\end{axis}
\end{tikzpicture}

\end{document}


All I get is a 2d axis! I am plotting other data as well; everything is working just fine, except the 3D rectangle. So I posted the code without the other plots. I am not getting any errors. It is true that the coordinates are a bit large, but he then can scale the axis simply.

-
I got the error: You have an axis with empty range (in direction y). Replacing it with a default range and clearing all plots. may be help you. – ferahfeza Mar 9 '14 at 12:30

Following what @ferahfeza mentioned, I just changed your source. Is this what you want?

\documentclass[tikz]{standalone}
\usepackage{pgfplots,pgfplotstable}
\usetikzlibrary{calc}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view = {-40}{20},
xmin=0,xmax=10,
ymin=1,ymax=100,
zmin=9e5,zmax=13e5,
xlabel={x},
ylabel={t },
zlabel={y}
]
\filldraw [red, thick,rounded corners] (axis cs:6.3,1,10e5) rectangle (axis cs:6.3,100,12e5);
\end{axis}
\end{tikzpicture}

\end{document}


-
yes, but how come you are supplying the same x-coordinates (6.3) and the rectangle is not aligned on the yz plane? – user2536125 Mar 10 '14 at 17:44