Inspired by Extract x, y coordinate of an arbitrary point in TikZ, I am trying to use the x coordinate of a point to draw another element.
However, when I use the yscale and xscale commands, the extracted coordinates do not similarly scale up. Here is an example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture} % First picture
\draw[->] (0,0) -- (2,0) ;
\draw[->] (0,0) -- (0,2) ;
\coordinate (z) at (0.5,0);
\path (z) node[below] {$z$};
\pgfgetlastxy{\XCoord}{\YCoord};
\coordinate (kink) at (\XCoord,\XCoord);
\draw[gray] (0,0) -- (kink) node[above, red] {$c$};
\end{tikzpicture}
\begin{tikzpicture}[yscale=4,xscale=6] % Second picture
\draw[->] (0,0) -- (2,0) ;
\draw[->] (0,0) -- (0,2) ;
\coordinate (z) at (0.5,0);
\path (z) node[below] {$z$};
\pgfgetlastxy{\XCoord}{\YCoord};
\coordinate (kink) at (\XCoord,\XCoord);
\draw[gray] (0,0) -- (kink) node[above, red] {$c$};
\end{tikzpicture}
\end{document}

In the first picture, the extracted coordinate works as expected. In the second picture, I try to scale up the entire picture, but the extracted coordinate now extends off of the page. How do I get the extracted coordinate to scale correctly?

[y=4cm,x=6cm]instead of[yscale=4,xscale=6]. – Gonzalo Medina May 27 '13 at 00:32\coordinate (kink) at (\XCoord,\XCoord);in the second picture. When I do that, the node extends way off the page. But, as you say, the answers below solve the problem. – profj May 27 '13 at 20:17