title: How to turn y axis of histogram to show percentage ranging from 0 to 1
body: <p>I want to change the y axis of the histogram to show percentages ranging from 0 to 1. this is what I've tried, but it doesn't seem to be working.</p>
  
  <pre><code>    myTolerance=1e-12; % in erg units.
        nbins=50;
      for j=1:ntM/100:ntM
  
         H = histfit(Wkinet(abs(Wkinet(:,j))&gt;myTolerance, j) * erg2eV, nbins);
      %Select from column j all rows in column j whose absolute values are 
      %greater than the tolerance.
      H(1).delete; %%Remove bins, only keep the fit.
         set(gca, 'YScale', 'log');
          set(gca, 'XScale', 'log'); % Make logarithmic X
           yt = get(gca, 'YTick');
          set(gca, 'YTick', yt, 'YTickLabel', 
          yt/numel(Wkinet(abs(Wkinet(:,j))&gt;myTolerance)))
  
        pause;
     end
  </code></pre>
  
  <h1>This is what is currently looks like:</h1>
  
  <p><img src="https://i.stack.imgur.com/SpZ81.png" alt="Output Graph"></p>
  
  <h1>This is what I want:</h1>
  
  <p><img src="https://i.stack.imgur.com/rTLgY.png" alt="Desired output graph"></p>