title: present histograms in different colors - matlab
body: <p>I am trying to present two histograms, and I want each of them to be in a different color. lets say one red and one blue. so far I menaged the change the colors of both of them, but only to the same color.<br>
  this is the code  </p>
  
  <pre><code>close all  
  b=-10:1:10;
  x=randn(10^5,1);  
  x=(x+5)*3;  
  y=randn(1,10^5);  
  y=(y+2)*3;  
  hist(x,100)  
  hold on   
  hist(y,100);  
  
  h = findobj(gca,'Type','patch');   
  set(h,'FaceColor','r','EdgeColor','w')  
  %the last two lines changes the color of both hists.
  </code></pre>