# Defining a variable in Tikz and using it in a table

I read the page Define a variable in TikZ about how to define a variable in tikz, but I am trying to then put these values in a table and getting errors. It seems latex is not remembering the white space and treating both entries of the table as one.

It also seems to work fine when the variable is an integer.

Minimal example with error:

\def\xmin{-2};
\def\Kone{-1.826110508097425};
table[row sep=crcr]{
\xmin+0    1\\
\Kone     1\\
-1.826110508097425 0.6\\
\xmin 0.6\\
};


The error I get is

" Package pgfplots Error: Sorry, the requested column number '1' in table '' does not exist!? Please verify you used the correct index 0 <= i

Alternatively, if there is a better way round of drawing that filled area using the variables it would be helpful!

• You need to put the macro involving entries of the table inside brace pair {} – percusse Dec 11 '14 at 12:48
• @percusse perhaps you could turn your comment into an answer so OP can accept it? – nnunes Dec 11 '14 at 13:12

\addplot [fill, color=green,solid,forget plot, opacity=0.2]