title: GNUPLOT: saving data from smooth cumulative
body: <p>I make this simple cumulative and histogram plot of a uniform random distribution of real numbers (n=1000): </p>
  
  <p><a href="http://www.filedropper.com/random1_1" rel="nofollow noreferrer">http://www.filedropper.com/random1_1</a>: random1.dat</p>
  
  <p>And the macro is:</p>
  
  <pre><code>unset key
  clear
  reset
  
  
  n=120 #number of intervals
  max=4. #max value
  min=1. #min value
  
  width=(max-min)/n #interval width
  #function used to map a value to the intervals
  bin(x,width)=width*floor(x/width)+width/2.0 # cosi viene centrato in mezzo
  set xtics min,(max-min)/10,max
  set boxwidth width
  set style fill solid 0.5 border
  
  
  set ylabel 'Frequency'
  set y2label 'Cumulative frequency'
  set y2tics 0,100,1000
  set ytics nomirror
  
  set xrange [0.9:4.1]
  set yrange [0:25]
  
  set terminal pngcairo size 800,500 enhanced font 'Verdana,14'
  set output "testCum.png"
  
  plot 'random1.dat' using (bin($1,width)):(1.0) smooth frequency with boxes title 'histogram',\
  '' using (bin($1,width)):(1.0) smooth cumulative axis x1y2 w l lt 2 lw 2 lc rgb 'green' title 'cumul'
  </code></pre>
  
  <p>Now the output.png is:</p>
  
  <p><img src="https://i.stack.imgur.com/7s3DN.png" alt="enter image description here"></p>
  
  <p>How I can tell to Gnuplot I want to take not only the cumulative plot but also the numbers coming from it saved in a particular file.dat ? </p>