squiggle.c

Self-contained Monte Carlo estimation in C99
Log | Files | Refs | README

term1.gp (594B)


      1 reset
      2 set terminal dumb size 80, 25
      3 max=3
      4 min=-3
      5 n=100 #number of intervals
      6 width=(max-min)/n #interval width
      7 #function used to map a value to the intervals
      8 hist(x,width)=width*floor(x/width)+width/2.0
      9 set xrange [min:max]
     10 set yrange [0:]
     11 #to put an empty boundary around the
     12 #data inside an autoscaled graph.
     13 set offset graph 0.05,0.05,0.05,0.0
     14 set xtics min,(max-min)/5,max
     15 set boxwidth width*0.9
     16 set style fill solid 0.5 #fillstyle
     17 set tics out nomirror
     18 set xlabel "x"
     19 set ylabel "Frequency"
     20 #count and plot
     21 plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle