title: Using "imhist" function in Matlab to plot multiple histograms on the same figure
body: <p>I'm new to Matlab and am trying to do a bit of image processing.  I have two color images that I convert to grayscale. My goal is to be able to put the histograms for both grayscale images on the same figure so I can compare them.  My code looks like this:</p>
  
  <pre><code>a=imread('image1.jpg')
  agray=rgb2gray(a)
  b=imread('image2.jpg')
  bgray=rgb2gray(b)
  figure,imhist(agray)
  figure,imhist(bgray)
  </code></pre>
  
  <p>The code works fine for looking at the two histograms independently, but I can find how to combine them into one figure for comparison. Please help!!</p>