# Cannot access column name in pgfplotsstable

I followed the standard way (to the extent of my knowledge) of accessing the column name in pgfplotstable but it doesn't seem to be working.

This is the code:

\begin{figure}[H]
\pgfplotstabletypeset[
col sep=comma,
string type,
columns/name/.style={column name=$\epsilon$, column type={|c|}},
columns/surname/.style={column name=$\phi$, column type={|c|}},
every last row/.style={after row=\hline},
]{test.csv}
\caption{Results}
\end{figure}


and this is what it generates:

It is supposed to have \phi and \epsilon in there but it doesn't. This is what the data file test.csv contains

parameter,test
1,2
1,2
1,3


Thanks for the help.

• Your column names are not name and surname but parameter and test. Where do you want \phi and \epsilon? – user11232 Aug 19 '14 at 23:18
• Hi @HarishKumar , I need to replace parameter and test with \phi and \epsilon respectively. – kolonel Aug 19 '14 at 23:22

You have to use the proper header names of columns. Your columns have names parameter and test but you are using name and surname. Change them to

    columns/parameter/.style={column name=$\epsilon$, column type={|c|}},
columns/test/.style={column name=$\phi$, column type={|c|}},


Code:

\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.10}
\usepackage{filecontents}
\begin{filecontents*}{test.csv}
parameter,test
1,2
1,2
1,3
\end{filecontents*}
\begin{document}
\begin{figure}[H]        %% why figure?
\centering
\pgfplotstabletypeset[
col sep=comma,
string type,
columns/parameter/.style={column name=$\epsilon$, column type={|c|}},
columns/test/.style={column name=$\phi$, column type={c|}},

I have also corrected the second column type={c|} (for test).
• @kolonel: I am not getting both of them. Hence it is hard to say without seeing your code. Have you put \centering as I did? Figure 1: is default. May you have changed something, may be with caption package? – user11232 Aug 19 '14 at 23:57