pgfplotsstable の列名にアクセスできません

pgfplotsstable の列名にアクセスできません

私は、pgfplotstable の列名にアクセスするための標準的な方法 (私の知る限り) に従いましたが、うまくいかないようです。

コードは次のとおりです:

\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 head row/.style={before row=\hline,after row=\hline},
    every last row/.style={after row=\hline},
    ]{test.csv}
\caption{Results}
\end{figure}

そして、これが生成されるものは次のとおりです。 ここに画像の説明を入力してください

\phiそこにはとがあるはずです\epsilonが、ありません。これがデータファイルtest.csvに含まれるものです。

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

助けてくれてありがとう。

答え1

列の適切なヘッダー名を使用する必要があります。列の名前はparameterと ですが、とをtest使用しています。これらを に変更します。namesurname

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

コード:

\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|}},
    every head row/.style={before row=\hline,after row=\hline},
    every last row/.style={after row=\hline},
    ]{test.csv}
\caption{Results}
\end{figure}
\end{document}

ここに画像の説明を入力してください

2番目も修正しましたcolumn type={c|}(テスト用)。

関連情報