squiggle.c/scratchpad/plotting/gnuplot/term3.gp

14 lines
350 B
Plaintext
Raw Normal View History

2024-01-30 12:46:52 +00:00
reset
set terminal dumb size 80, 25
2024-01-30 12:54:01 +00:00
2024-01-30 12:46:52 +00:00
n=100 #number of intervals
2024-01-30 12:54:01 +00:00
max=3. #max value
min=-3. #min value
2024-01-30 12:46:52 +00:00
width=(max-min)/n #interval width
#function used to map a value to the intervals
hist(x,width)=width*floor(x/width)+width/2.0
set boxwidth width*0.9
2024-01-30 12:54:01 +00:00
2024-01-30 12:46:52 +00:00
#count and plot
plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle