2

This question is similar to this one I asked before: How to apply 3D transform to arrows in TikZ.

But there I was using the 3d library in TikZ. This question is about tikz-3dplot.

How can I rotate the arrowheads? Consider this minimal example:

enter image description here

Take the z-axis arrowhead as an example. I would like to be able to transform it so it lies in x-z plane or y-z plane. Is this possible?

MWE

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

\begin{document}

\tdplotsetmaincoords{60}{120}
\begin{tikzpicture}[tdplot_main_coords]

\coordinate (O) at (0,0,0);
\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}
1

1 Answer 1

3

You can use the 3d library to be able to use canvas is xz plane at y and \pgflowlevelsynccm to transform the arrows. The following has the z axis in the xz plane and the two other axes in the xy plane.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}

\tdplotsetmaincoords{60}{120}
\begin{tikzpicture}[tdplot_main_coords]

\coordinate (O) at (0,0,0);
\begin{scope}[canvas is xz plane at y=0]
 \path  (0,1) node[anchor=south]{$z$}; 
 \pgflowlevelsynccm
 \draw[thick,->] (0,0) -- (0,1); 
\end{scope}
\begin{scope}[canvas is xy plane at z=0]
 \path (1,0) node[anchor=north east]{$x$}
  (0,1)  node[anchor=north west]{$y$};
 \pgflowlevelsynccm
 \draw[thick,->] (0,0) -- (1,0);
 \draw[thick,->] (0,0) -- (0,1);
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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