\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotstableset{
create on use/mean/.style args={#1#2#3}{
create col/expr={(\thisrowno{#1} + \thisrowno{#2} + \thisrowno{#3})/3}
}
}
\begin{document}
\pgfplotstableread{
1 1 2 3
2 2 3 4
3 3 4 5
4 4 5 6
}\mydata
\begin{tikzpicture}
\begin{axis}[]
\addplot[] table [x index=0, y=mean{1}{2}{3}] {\mydata};
\end{axis}
\end{tikzpicture}
\end{document}
這段程式碼給出了錯誤抱歉,無法從...檢索列“mean{1}{2}{3}”
我想要的是計算表的三列(具有給定索引)的平均值。
我該怎麼做?