# How do I draw 3-D axes in TIKZ?

Can someone help me draw this? I need it to show the effect of a rotated polarizing component, and things always looks better in tikz, my my skills are sub-standard.

• With tikz-3dplot this is really straightforward. Are you aware of this package? – marmot Mar 1 at 3:17
• no how does it work? – easychachi Mar 1 at 3:25
• Welcome to TeX.SX. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with \documentclass, includes all relevant \usepackage commands, ends with \end{document} and compiles without errors, even if it does not produce your desired output. On this site there is an expectation that posters will make an attempt at the solution (even if it's just a start), rather than just asking for someone to do it for them. – Sandy G Mar 1 at 3:48

This is a rather basic task for the tikz-3dplot package and the 3d library. The package allows you to obtain orthographic projections for any view angles. The 3d library allows you to switch to a plane and project things therein.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d,arrows.meta}
\begin{document}
\tdplotsetmaincoords{0}{0}
\tdplotsetrotatedcoords{-30}{60}{45}
\begin{tikzpicture}[tdplot_rotated_coords,thick,>={Latex[length=5pt]},
font=\sffamily,pics/.cd,
3d xy axes/.style args={#1/#2/#3}{code={
\draw[->] (-3,0,0) -- (3,0,0) node[pos=1.05] {$#1$};
\draw[->] (0,-3,0) -- (0,3,0) node[pos=1.05] {$#2$};
\node at (-1.5,-1.5,0) {$#3$};
}}]
\foreach \X/\Y/\S [count=\Z] in {x/y/S,x/y/S',x'''/y'''/S'''}
{\path (0,0,6*\Z) pic {3d xy axes={\X/\Y/\S}};
\draw[red,->] (0,0,-3+6*\Z) -- (0,0,3+6*\Z);}
\begin{scope}[canvas is xy plane at z=12,rotate=30]
\draw[->] (-3,0) -- (3,0) node[pos=1.05] {$x'$};
\draw[->] (0,-3) -- (0,3) node[pos=1.05] {$y'$};
\draw (1,0) arc(0:-30:1) node[pos=0.5,right,transform shape]{$\theta$};
\end{scope}
\node[anchor=north] at (0,-3.2,6) {Incident beam};
\node[anchor=north,align=left] at (0,-3.2,12) {Rotated polarizing\\ element};
\node[anchor=north] at (0,-3.2,18) {Emerging beam};
\end{tikzpicture}
\end{document}