10

is it possible to set a different orthonormal base for the xyz coordinate space? for example, the default one is x=(1,0,0) y=(0,1,0) and z=(0,0,1).

I would want to set this base: x=(1,0,0) y=(0,0,1) and z=(0,1,0) so that when i draw a line from (0,0,0) to (0,1,0) it will be rendered as a line from (0,0,0) to (0,0,1) using default xyz coordinates.

i tried setting

    \begin{tikzpicture}[x={(1,0,0)},y={(0,0,1)},z={(0,1,0)}]

but it seems only to distort the drawing. I would like to avoid using pgfplots, if possible.

thank you in advance for your attention

2 Answers 2

8

According to the manual, the default z unit vector is (-3.85mm, -3.85mm). If you set y={(-3.85mm, -3.85mm)} and z={(0cm,1cm)} the default y and z axis will be switched, if I'm not mistaken. TikZ draws everything in 2D space, so the unit vectors are 2D as well.

5

Looks like a job for the tikz-3dplot package. It draws in the well known base.

\documentclass{minimal}
\usepackage{tikz}
\usepackage{tikz-3dplot}


\begin{document}
  \tdplotsetmaincoords{70}{110}
  \begin{tikzpicture}[tdplot_main_coords]
    \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
    \draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
    \draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
  \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .