I have this file as data.dat:
Xstep Y1 Y2 Y3 Y4
332 1.22 0.00 0.00 1.43
336 5.95 12.03 6.11 10.41
340 81.05 81.82 81.92 81.05
394 11.76 6.16 10.46 5.87
398 0.00 0.00 1.51 1.25
1036 0.03 0.00 0.00 0.00
I can plot this data as a histogram using this script, hist-v1.gplot(using set style data histogram):
set xlabel "X values"
set ylabel "Occurence"
set style data histogram
set style histogram cluster gap 1
set style fill solid border -1
set term png
set output 'hist-v1.png'
set boxwidth 0.9
set xtics ("332" 332, "336" 336, "340" 340, "394" 394, "398" 398, "1036" 1036)
plot 'data.dat' using 2:xtic(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col
And calling:
gnuplot hist-v1.gplot && eog hist-v1.png
this image is generated:
image hist-v1.png http://img202.imageshack.us/img202/3974/histv1.png
However, you may notice that the X axis does not scale numerically - it understands the values ββof X as categories (i.e. this is a category).
I can get a more digital X axis with the following script, hist-v2.gplot(using with boxes):
set xlabel "X values"
set ylabel "Occurence"
set style data histogram
set style histogram cluster gap 1
set style fill solid border -1
set term png
set output 'hist-v2.png'
set boxwidth 0.9
set xr [330:400]
set xtics ("332" 332, "336" 336, "340" 340, "394" 394, "398" 398, "1036" 1036)
plot 'data.dat' using 1:2 ti col smooth frequency with boxes, '' u 1:3 ti col smooth frequency with boxes
And calling:
gnuplot hist-v2.gplot && eog hist-v2.png
this image is generated:
image hist-v2.png http://img266.imageshack.us/img266/6717/histv2.png
Unfortunately, the bars overlap here, so itβs hard to read the chart.
X hist-v2.png, "" , hist-v1.png? , " Re: x" , :
x- ,...
...
,
!