在“\addplot table”选项中使用“x expr”时出错

在“\addplot table”选项中使用“x expr”时出错

x expr我在 Tikz/pgfplots 中的选项中没有成功使用\addplot table。我不认为问题出在包是否安装上,因为我已经使用了\addplot table很长时间。

参见我的最小示例:

\documentclass{article}

\usepackage{pgfplots}
\usepackage{filecontents}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}


\begin{document}
%
\begin{tikzpicture}
%
\begin{axis}
\addplot table [col sep=comma, x index=0, y expr = \thisrowno{1}-1] {./antinumu/table_dm2_minimized.csv};
%
\end{axis}
%
\end{tikzpicture}
%
\end{document}

Linux终端错误信息:

! Package pgfkeys Error: I do not know the key '/tikz/y expr' and I am going to
 ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.15 ...}-1] {./antinumu/table_dm2_minimized.csv};

? H
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

相关内容