[Tex/LaTex] How to draw straight lines between nodes in commutative diagram without using TikZ matrix library

arrowsdiagramstikz-pgf

I want to draw a commutative diagram with TikZ as follows:

\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{tikzpicture}[auto]
\node (S1) {$\sigmaSet \cap X_N$};
\node (S2) [below= 2cm and 4cm of S1] {$\sigmaSet \cap X_N$};
\node (S3) [below= 2cm and 4cm of S2] {$\discreteSigmaSet$};
\node (U1) [right= 2cm and 4cm of S1] {$\potentialSpace$};
\node (U2) [below= 2cm and 4cm of U1] {$Y_M$};
\node (U3) [below= 2cm and 4cm of U2] {$\R^M$};
\draw[->] (S1) to node {$F_f$} (U1);
\draw[->] (S2) to node {$\widetilde{F}_f$} (U2);
\draw[->] (S3) to node {$\widehat{F}_f$} (U3);
\draw[->] (S1) to node [swap] {$I$} (S2);
\draw[->] (S2) to node [swap] {$\theta_{B_N}$} (S3);
\draw[->] (U1) to node {$P^{\psprod{E}{\cdot}{\cdot}}_{Y_M}$} (U2);
\draw[->] (U2) to node {$\theta_{C_M}$} (U3);
\end{tikzpicture}

which looks like this:

enter image description here

Note how the horizontal arrows are not straight, but end too high on the right side.

Now my question is how I can make TikZ draw the horizontal arrows as straight lines. Is there a way to accomplish this without having to use the matrix library? I want to keep the code above as simple as possible.

Best Answer

You can use the (p |- q) notation, meaning the intersection of a vertical line through p and a horizontal line through q.

Code

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[auto]
\node (S1) {$\sigma \cap X_N$};
\node (S2) [below= 2cm and 4cm of S1] {$\sigma \cap X_N$};
\node (S3) [below= 2cm and 4cm of S2] {$\sigma$};
\node (U1) [right= 2cm and 4cm of S1] {$\gamma$};
\node (U2) at (U1 |- S2) {$Y_M$};
\node (U3) at (U2 |- S3) {$R^M$};
\draw[->] (S1) to node {$F_f$} (U1);
\draw[->] (S2) to node {$\widetilde{F}_f$} (U2);
\draw[->] (S3) to node {$\widehat{F}_f$} (U3);
\draw[->] (S1) to node [swap] {$I$} (S2);
\draw[->] (S2) to node [swap] {$\theta_{B_N}$} (S3);
\draw[->] (U1) to node {$P^{\hat{E}{\cdot}{\cdot}}_{Y_M}$} (U2);
\draw[->] (U2) to node {$\theta_{C_M}$} (U3);
\end{tikzpicture}

\end{document}

Output

enter image description here