包 pgfkeys 错误:我不知道键‘/tikz/y error plus index’

包 pgfkeys 错误:我不知道键‘/tikz/y error plus index’

我在编译附加的 mwe 时遇到了麻烦。我收到以下消息:“Package pgfkeys 错误:我不知道密钥‘/tikz/y error plus index’,我将忽略它。也许您拼错了。”tikz 图片是由 matlab2tikz 创建的,因此我很惊讶它无法编译。有人能告诉我哪里出了问题吗?

\documentclass[a4paper,titlepage,11pt]{article}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{positioning, arrows}
\usetikzlibrary{external}

\begin{document}

\begin{tikzpicture}
\begin{axis}[%
width=4.30216535433071in,
height=3.3931594488189in,
scale only axis,
xmin=0,
xmax=12,
xlabel={x},
ymin=9000,
ymax=17000,
ylabel={y}
]
\addplot [color=blue,only marks,mark=*,mark options={solid},forget plot]
 plot [error bars/.cd, y dir = both, y explicit]
 table[row sep=crcr, y error plus index=2, y error minus index=3]{1.84  16218   134.776481295696    134.776481295696\\
3.68    14575   127.048609378389    127.048609378389\\
5.52    13049   119.621537352246    119.621537352246\\
7.36    11775   113.088768071349    113.088768071349\\
9.2 10533   106.531395413076    106.531395413076\\
11.04   9374    100.152475255634    100.152475255634\\
};
\addplot [color=red,solid,forget plot]
  table[row sep=crcr]{1.84  16243.611047826\\
3.68    14567.6214518194\\
5.52    13064.55775989\\
7.36    11716.5777560882\\
9.2 10507.6801555369\\
11.04   9423.51466013115\\
};
\end{axis}
\end{tikzpicture}
\end{document}

答案1

您的代码适用于 TexLive 2014。

结果如下

在此处输入图片描述

相关内容