title: matlab: 2D data binning
body: <p>I need some help with calculating cumulative distribution. </p>
  
  <p>lets say I have data like that:</p>
  
  <pre><code>data = abs(randn(1000,1));
  </code></pre>
  
  <p>I have to calculate probability cumulative distribution and bin it to reduce amount of points. I am doing it like that (lets take bin = 50):</p>
  
  <pre><code>[n, x] = hist(data, 50);
  y = cumsum(n);
  y = y./max(y);
  </code></pre>
  
  <p>The problem is, that now I have a lot of points close to y=1, but only few close to zero. I'd like to have kind of equal distribution distribution of points (additional binning on y axis?). I hope you know what I mean :) How I can do that? 
  Thanks!</p>