![生の gnuplot を使用した pgfplots のエラーバー](https://rvso.com/image/309856/%E7%94%9F%E3%81%AE%20gnuplot%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F%20pgfplots%20%E3%81%AE%E3%82%A8%E3%83%A9%E3%83%BC%E3%83%90%E3%83%BC%20.png)
私は、gnuplot を使用してデータを前処理する方がよいため、常に pgfplots を 'raw gnuplot' オプションと組み合わせて使用します。(曲線フィッティング、複雑な計算など)
現在、私は「raw gnuplot」オプションを使いながら、プロットにエラーバーを追加しようとして問題に直面しています。マニュアルを確認し、インターネットで解決策を探しましたが、見つかったのは、あまり満足のいくものではない回避策だけでした。
% !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape --synctex=1 --interaction=nonstopmode]
\documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents*}{data.dat}
#x y x_err y_err
1 2 0.5 0.5
2 8 0.3 0.3
3 9 0.7 0.3
4 1 0.5 0.5
5 2 0.5 0.9
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot gnuplot [
draw=none,
mark=none,
forget plot,
raw gnuplot,
] {
plot 'data.dat' using 1:2:3:4 with xyerrorbars;
};
\addplot+ [
error bars/.cd,
y dir=both,y explicit,
x dir=both,x explicit,
] table [
x error expr=((\thisrowno{3}-\thisrowno{2})/2),
y error expr=((\thisrowno{5}-\thisrowno{4})/2),
]{\jobname.pgf-plot.table};
\end{axis}
\end{tikzpicture}
\end{document}
誰か、「raw gnuplot」を使用しながらエラーバーを追加でき、2 番目の「addplot table」を必要としないソリューションを教えてくれませんか?