pgfplots - 错误范围与其定义不匹配

pgfplots - 错误范围与其定义不匹配

我想在条形图中添加误差线,使情况非常类似于pgfplots - plusminus 与其定义不符

但我得到了一个不同的错误。代码如下:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
    xticklabels = {xlabel},
    ybar = 0.2pt,
]

\addplot[error bars/.cd, y dir = both, y explicit]
    coordinates {
(1, 0.9798043478262296) += (0, 0.012972979771813395) -= (0, 0.012972979771813395)

};

\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}

错误如下:

Package pgfplots notification 'compat/show suggested version=true': you might benefit from \pgfplotsset{compat=1.7} (current compat level: 1.6).

! Use of \pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE doesn't match its definition.
<argument>  (1, 0.9798043478262296) +=
                                       (0, 0.012972979771813395) -= (0, 0.01...
l.41 };

? X
No pages of output.

当我注释掉该+= ...部分时,代码可以编译。我该怎么办?

相关内容