I use pgfplots always in combination with the 'raw gnuplot' option because I like it better to preprocess my data using gnuplot. (curve fitting, complex calculations etc.)

Now I am facing a problem since I try to add errorbars to my plot, still using the 'raw gnuplot' option. I checked the manual and searched the internet for a solution, all I found was a workaround that isn't really satisfying:

% !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape --synctex=1 --interaction=nonstopmode]


#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


        \addplot gnuplot [
        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),


Anyone can help me with a solution, that can add errorbars while using 'raw gnuplot' and doesn't need the second 'addplot table'?

closed as off-topic by Stefan Pinnow, user31729, CarLaTeX, Mensch, Zarko Feb 18 '17 at 20:51

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • No, there is no way to do that. PGFPlots will only look for the first two columns and process these when option gnuplot (and its friends) is(/are) used. As Christian told me, this will not be changed (in the near and mid future). Said this I think you already have the optimal solution ... Hopefully you will agree that I will vote to close this question as "unsolvable". – Stefan Pinnow Feb 18 '17 at 19:14
  • 5
    I'm voting to close this question because there is no possibility to solve the problem in the way OP is requesting it. (This will also not change in the near and mid future.) – Stefan Pinnow Feb 18 '17 at 19:15

Browse other questions tagged or ask your own question.