Consider this MWE:
\documentclass[tikz]{standalone}
\usepackage{mwe}
\begin{document}
\begin{tikzpicture}
\draw [help lines, step=1cm] (0,0) grid (4,2);
\coordinate[label={$X$}] (X) at (0,0);
\coordinate[label={$Y$}] (Y) at (4,0);
\draw[thick, red, yshift=2cm] (0,0)--(4,0);
\draw[thick, blue, yshift=2cm] (X)--(Y);
\end{tikzpicture}
\end{document}
Compiling this with pdflatex
produces this image:
Why isn't the blue line over the red one (as I would expect)? The only difference between them is that the blue line uses the named versions of the coordinates. I tried googling this and read the pgfmanual, but couldn't find the answer (could not find an example with named coordinates).
\draw[thick, blue, ] ([yshift=2cm]X)--([yshift=2cm]Y);