This question is related to Strange behavior in TikZ \draw command but is not the same.
While working with coordinates and nodes in TikZ, I was expecting that:
\coordinate (x) at (4,0) node[right] {$x$};
\coordinate (y) at (0,3) node[above] {$y$};
and
\node[right] at (x) {$x$};
\node[above] at (y) {$y$};
would yield the same result. But they don't. I get the following output:
With \coordinate (x) at (4,0) node[right] {$x$};, I meant, the system will create a node at (4,0) and will place the text $x$ to its right.
Based on the output, I see the text $x$ is placed at (0,0), with the above command.
Why does this happen.
MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\coordinate (x) at (4,0) node[right] {$x$};
\coordinate (y) at (0,3) node[above] {$y$};
\node[right] at (x) {$x$};
\node[above] at (y) {$y$};
\draw[<->,thick] (0,3) |- (4,0);
\end{tikzpicture}
\end{document}





\path (x) node[right] {$x$};\path (y) node[above] {$y$};. If you give TikZ contradicting instructions, or place the instructions in the wrong order, you will get an unexpected result. BTW, you expect answerers to provide you with a full MWE, i.e. a document that starts with\documentclassetc. Could you please consider also using such an MWE in your question? – Mar 25 '19 at 16:53drawoption to the nodes, and you will probably see the difference. – Mar 25 '19 at 17:02\coordinate (x) at (4,0) node[right] {$x$};theat (4,0)gets eaten up by\coordinate (x) atand then TikZ "sees"node[right] {$x$}and inserts the default coordinate(0,0)to parse it. – Mar 25 '19 at 18:51