Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
add comment

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.