Like Andrew wrote, 3d is not in the documentation. I updated my answer because I introduced some mistakes and complications. First we need to define the vectors for the xyz system, then with the 3d
library options, we can work in a specific plane.
canvas is xy plane at z=0
I design the plane xy with z=0
, I made a mistake with yx
because in this case I exchange the vectors x
and y
.
Here a list of the options in 3d
coordinate system xyz cylindrical
coordinate system xyz spherical
/tikz/cs/longitude/
/tikz/cs/latitude/
plane origin
plane x
plane y
canvas is plane
canvas is xy plane at z
canvas is yx plane at z
canvas is xz plane at y
canvas is zx plane at y
canvas is yz plane at x
canvas is zy plane at x
The code :
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows,3d}
% see the explanation below
\makeatletter
\tikzoption{canvas is xy plane at z}[]{%
\def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
\def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}%
\def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}%
\tikz@canvas@is@plane
}
\makeatother
\begin{document}
\begin{tikzpicture}
[x={(0.866cm,0.5cm)}, y={(-0.866cm,0.5cm)}, z={(0cm,1cm)}, scale=2]
\draw[->,red] (0,0,0) -- (1,0,0);
\draw[->,red] (0,0,0) -- (0,1,0);
\draw[->,red] (0,0,0) -- (0,0,1);
\begin{scope}[canvas is xy plane at z=0]
\draw[blue,shift={(1.5,0)}] (0,0) -- (1,0)--(1,1)--(0,1)--cycle;
\draw[blue,shift={(3,0)}] (0,0) -- (1,0)--(1,1)--(0,1)--cycle;
\end{scope}
\end{tikzpicture}
\end{document}
The code for the option used in my example is
\tikzoption{canvas is xy plane at z}{%
\tikz@addtransform{\pgftransformshift{\pgfpointxyz{0}{0}{#1}}}%
}
This is only a shift transformation.
Update
As Jake noticed in this answer grid in 3d
The implementation of canvas is xy plane at z in
tikzlibrary3d.code.tex is incorrect, it merely sets a coordinate
shift, but doesn't activate the full transformation code necessary.
You can redefine the key correctly within your document:
\makeatletter
\tikzoption{canvas is xy plane at z}[]{%
\def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
\def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}%
\def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}%
\tikz@canvas@is@plane
}
\makeatother
I forgot this and it is why I use yx
instead of xy
in my first attempt.

x={(0.86cm,0.5cm)},y={(-0.86cm,0.5cm)}
into yourtikzpicture
options to get an isometric perspective. If you want to use 3D coordinates, you also have to specifyz={(0cm,1cm)}
, and use three dimensional coordinates (like\draw (0,0,1) -- (2,1,3)
). – Jake Jun 11 '12 at 7:26