Consider this MEW,
\nonstopmode
\documentclass{article}
\usepackage{tikz,amsmath}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw [gray!10](-0.2, -0.2) grid[step=.25] (3.2,3.2) ;
\draw [gray!25](-0.2, -0.2) grid[step=.5] (3.2,3.2) ;
\path
(0, 3) node[left] {$y$}
(3, 0) node[below] {$x$} ;
\draw [-latex](-.2, 0) -- (3,0);
\draw [-latex](0, -.2) -- (0,3);
\draw [thick, cyan!50!black, -latex]
(0,0) node [coordinate](origin){}
--
(60:2.5) node [coordinate](pa){}
node [above, black]{$p_a$}
(origin)
--
(30:2.5) node [coordinate](pb){}
node [above, black]{$p_b$};
\newdimen\pax
\newdimen\pay
\pgfextractx{\pax}{(pa)}
\pgfextracty{\pay}{(pa)}
\draw [yellow!75!black](pa) -- (\pax, 0);
\draw [yellow!75!black](pa) -- (0, \pay);
\draw [magenta](pb) -- (\pax, 0);
\draw [magenta](pb) -- (0, \pay);
\end{tikzpicture}
\end{document}
which produces this picture below:
At \pgfextractx{\pax}{(pa)}, I am trying to extract the x component of the node coordinate (pa) (same with y component), and trying to draw perpendicular with yellow lines to their respective axes. But pgfextractx is giving me the x/y component of node coordinate (pb), which I have drawn with the magenta lines.
How can I extract the correct x/y values from the node coordinate (pa) with \pgfextractx?
I only looked at pgfmanual.pdf which doesn give a lot of examples of \pgfextracttx.


\pgfextractx{\pax}{(pa)}with\pgfextractx{\pax}{\pgfpointanchor{pa}{center}}. You are not in the frontend layer here, so you cannot use the parentheses syntax. – Jasper Habicht Jan 31 '24 at 10:00\pgfextractxdoes not do wht you think it does, see https://tex.stackexchange.com/a/273746/3929 for an alternative. Apointin this context is probably a low level pgf point not something named as(pa). I'm guessing you're getting something like this in your log:Missing character: There is no ( in font nullfont!which is an indicator that something is wrong. – daleif Jan 31 '24 at 10:01Missing charactererror was. – sigsegv Jan 31 '24 at 10:25