Fehlerbalken in pgfplots unter Verwendung von reinem Gnuplot

Fehlerbalken in pgfplots unter Verwendung von reinem Gnuplot

Ich verwende pgfplots immer in Kombination mit der Option „Raw Gnuplot“, da ich meine Daten lieber mit Gnuplot vorverarbeiten möchte. (Kurvenanpassung, komplexe Berechnungen usw.)

Jetzt stehe ich vor einem Problem, da ich versuche, Fehlerbalken zu meinem Diagramm hinzuzufügen, wobei ich immer noch die Option „Raw Gnuplot“ verwende. Ich habe das Handbuch überprüft und im Internet nach einer Lösung gesucht. Alles, was ich gefunden habe, war ein Workaround, der nicht wirklich zufriedenstellend ist:

% !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}

Kann mir jemand mit einer Lösung helfen, die Fehlerbalken bei der Verwendung von „Raw Gnuplot“ hinzufügen kann und die zweite „Addplot-Tabelle“ nicht benötigt?

verwandte Informationen