Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gnuplot asymmetric xy errorbars

Tags:

gnuplot

I need some help with Gnuplot 4.4 - I've been trying to get 2D data scatter plotted with errorbars in both the x and y dimensions.

Both x and y dimensions have high/low errorbars, that is the errorbars are not symmetric, so each data point uses six values (x,y,xlow,xhigh,ylow,yhigh). Gnuplot's man pages say this is possible and I've found examples on the net - both cases suggest using data files with six records for each data point (the (x,y,xlow,xhigh,ylow,yhigh) format) but I can't for the life of me get Gnuplot to behave.

The best I can do when plotting a single test point (1.0 3.0 0.25 0.5 0.25 0.5) is to get a plot of the test point with disembodied errorbars floating in nearby space.

like image 433
benjamin_sadler Avatar asked Sep 14 '25 13:09

benjamin_sadler


1 Answers

The reason your error bars are "disembodied" is that your x (1.0) is not between xlow (.25) and xhigh (.5). Your y (3.0) is also not between your ylow (.25) and yhigh (0.5).

If you want the lows and highs to represent the difference from the central variable, you should use a command like this:

plot "test.dat" u 1:2:($1-$3):($1+$4):($2-$5):($2+$6) with xyerrorbars t "test point"

Running this on your test file, I get the following plot:

Plot of questioner's example point

like image 77
Dan Avatar answered Sep 17 '25 20:09

Dan