It is claimed by Marc van Dongen at Use TikZ foreach variable in node that \x is a "TiKZ primitive". Does TikZ have primitives? I can't understand why on earth any package would make \x a primitive, and I assume that outside TeX engines/platforms only LuaTeX can make a package/user command equivalent to a primitive. Please can anyone tell me the meaning of the \x primitive? I can't see it defined outside or within tikzpicture!
EDIT
I have now seen what is going on. Although TikZ has no primitives, Marc van Dongen has a point. From cjorssen's example,
\draw plot[samples=10,domain=-5:5] (\y,{(\y)^2})
fails, while
\draw plot[variable=\y,samples=10,domain=-5:5] (\y,{(\y)^2})
works. In my humble opinion, PGF shouldn't have used a generic macro like \x as a default scratch macro, even in a local group or with a restored stack. It may be convenient for users, but, as we've seen, it is not the best choice of a scratch variable.
\next. – egreg Jul 20 '12 at 12:37\draw[domain=-1:1] plot (\x, {exp(\x)});intikz. – canaaerus Jul 20 '12 at 12:40\xhas a constant definition outside that context. If you add\show\x;, the answer will be\x=undefined. – egreg Jul 20 '12 at 12:46\x. In my more recent comment I clarify my comment why it is not clever to rely on a globally defined\xin tikz/pgfplots. The reason is that they may redefine\xas part of aletoperation. I also give an example. Hope this clarifies my comment. I still believe using\xin your example is flawed. – Marc van Dongen Jul 22 '12 at 15:51