Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. # http://gnuplot.sourceforge.net/demo/smooth.html
  2.  
  3. # http://gnuplot-surprising.blogspot.com/2011/09/statistic-analysis-and-histogram.html
  4. reset
  5. n=20 #number of intervals
  6. max=200. #max value
  7. min=0. #min value
  8. width=(max-min)/n #interval width
  9. #function used to map a value to the intervals
  10. hist(x,width)=width*floor(x/width)+width/2.0
  11. set xrange [min:max]
  12. set yrange [0:]
  13. #to put an empty boundary around the
  14. #data inside an autoscaled graph.
  15. set offset graph 0.05,0.05,0.05,0.0
  16. set xtics min,(max-min)/5,max
  17. set boxwidth width*0.9
  18. set style fill solid 0.5 #fillstyle
  19. set tics out nomirror
  20. set xlabel "x"
  21. set ylabel "Frequency"
  22. #count and plot
  23. plot "block_creation.txt" u (hist($2,width)):(1.0) smooth freq w boxes lc rgb"green" notitle
  24.  
  25.  
  26. # https://stackoverflow.com/questions/2471884/histogram-using-gnuplot
  27.  
  28. binwidth=20
  29. bin(x,width)=width*floor(x/width) + binwidth/2.0
  30.  
  31. plot 'block_creation.txt' using (bin($2,binwidth)):(1.0) smooth freq with boxes
  32.  
  33. plot 'block_creation.txt' using 2:(1.0) smooth kdensity bandwidth 10 with lines
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement