If you want both to be on the same axis, and you don't mind losing the bottom panel, try this (I don't have Image Toolbox right now, so I haven't tested it):
a=imread('image1.jpg') agray=rgb2gray(a) b=imread('image2.jpg') bgray=rgb2gray(b) [counts,x] = imhist(agray) stem(counts,x,'b') hold on [counts,x] = imhist(bgray) stem(counts,x,'r')
source share