# Text has been reflected in 3D plot

It seems that the text xz on the x-z plane of the 3D figure below has been reflected.

How to make it normal, just like yz on the y-z plane?

\documentclass{standalone}

\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows.meta}

\begin{document}
\tdplotsetmaincoords{60}{130}

\begin{tikzpicture}[scale=2,tdplot_main_coords]

\coordinate (O) at (0,0,0);
\coordinate (x) at (1,0,0);
\coordinate (y) at (0,1,0);
\coordinate (z) at (0,0,1);

\draw[thick, >=Stealth, ->] (O) -- (x) node[anchor = north]{x}; % x
\draw[thick, >=Stealth, ->] (O) -- (y) node[anchor = north]{y}; % y
\draw[thick, >=Stealth, ->] (O) -- (z) node[anchor = south]{z}; % z

\coordinate (xz) at (1,0,1);
\coordinate (yz) at (0,1,1);

% text on the yz plane
\draw[canvas is yz plane at x = 0, transform shape, draw = red, fill = red!50, opacity = 0.5] (yz) rectangle (O);
\node[canvas is yz plane at x = 0] at (0,0.5,0.5) {yz};

% text on the xz plane (Notice: it seems that the text has been reflected)
\draw[canvas is xz plane at y = 0, transform shape, draw = blue, fill = blue!50, opacity = 0.5] (xz) rectangle (O);
\node[canvas is xz plane at y = 0, align = center] at (0.5,0,0.5){xz};

\end{tikzpicture}
\end{document}

• Any idea how this plot can be extended to include an xy plane? I keep getting an unfortunately placed rectangle. Thanks! – Tyler Feb 16 '17 at 19:15
• @Tyler It seems that the way of \coordinate (xy) at (1,1,0); \draw[canvas is xy plane at z = 0, draw = red, fill = red!50, opacity = 0.5] (xy) rectangle (O); does not work. A workaround here: \coordinate (xy) at (1,1,0); \filldraw[fill = green!50, opacity = 0.5] (xy) -- (x) -- (O) -- (y) -- cycle; \node[canvas is xy plane at z = 0] at (0.5,0.5,0) {xy};. See the code. – hengxin Feb 17 '17 at 8:11

I have no idea why it's reflected, but you can reflect it back

\node[canvas is xz plane at y = 0, align = center] at (0.5,0,0.5){\reflectbox{xz}};


produces

• It is reflected because the transformation matrix to that plane has a negative determinant. If you were to rotate it such that x points right, the usual orientation would be restored. – marmot May 21 '18 at 22:13