1
votes

I am trying to create a histogram (barchart) with High and Low errors, using gnuplot. I have found this thread Gnuplot barchart histogram with errorbars Unfortunately it consists only from X value and X-error (2 vaues). Whats I would like to achieve is X value (average) and error bar consisting of High and Low values (total 3: avg, High and Low). How I can do this using gnuplot?example of what I am trying to do

My script is identical to the one mentioned in the Thread, I only changed some labels etc (simple cosmetic changes). My example dataset structure is as follows:

WikiVote 10 12 7
2
How is that not what you have? It seems to me that the bar is the average and then you have the errorbar for high and low ranges. What am I missing here? Please elaborate. - mgilson
The error bar high and low are same distance from Y. As far as I can tell my script takes col2 as avg and then creates both high and low errors based on col3 as a distance from avg. I would like it to use col2 as avg, col3 as high and col4 as low. - alien01

2 Answers

3
votes

If you have a very simple datafile:

#y ymin ymax
4   3    8

You can plot this datafile using:

set yrange [0:]
set style histogram errorbars gap 2 lw 1
plot 'datafile' u 1:2:3 w hist 
0
votes

I have modified the code provided by mgilson, to achieve multiple histograms for a single X value. If anybody needs it here is the code.

plot 'stack_2.dat' u 2:3:4:xtic(1) w hist ti "Hadoop" linecolor rgb "#FF0000", '' u 5:6:7:xtic(1) w hist ti "Giraph" lt 1 lc rgb "#00FF00"

Here is the pattern

    #y_0 #min #max #y_1 #min #max
Dataset 4   3    8    6    5    9