title: Histogram fit and kernal Density plot in MATLAB
body: <p>I want to plot histogram fit and kernel Density curve in one plot means in I figure ks density curve and histfit in one frame .</p>
  
  <p>Can someone help me how to do that.</p>
  
  <p>I am just presenting an example code what I want to do.</p>
  
  <p>Thanks a lot .</p>
  
  <pre><code>  x = rand([1 50])
    figure(1)
    histfit(x)
    hold on 
    [f,xi] = ksdensity(x);
    hold off
    figure
    plot(xi,f);
  </code></pre>