I am creating a graph where a node is placed. I would like to display the coordinates of that node on the axes without manually entering them.
I get Tikz to retrieve those coordinates using let
but then the coordinates are stored in TeX points instead of the original number. Is there a way for me to display it "nicely"?
Here the MWE:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,4);
\coordinate (origin) at (0,0);
\node[circle,fill] (d1) at (3,2) {};
\draw[red,thick] let \p{1} = (d1) in (d1|- origin) node[label=below:$\x1$]{} -- (d1) -- (d1 -| origin) node[label=left:\y1]{} ;
\end{tikzpicture}
\end{document}
I would instead like the numbers to read 2 and 3 on the vertical and horizontal axes respectively.
Should I use something like \pgfmathparse? I feel like TeX probably knows the value of 56.90549pt.