Subplot Histogram Plotting Mistake
Show older comments
Hello,
I am using that code at my project.
But I can't show histogram for my image. I added my result below too. Can you help me please?
Thank you
figure('Name','Org. Img + Histogram','NumberTitle','off');
subplot(2,1,1), imshow(org), title('Org. Img.');
subplot(2,1,2), imhist(org),title('Histogram of original image'), axis([0 270 0 8500]);

4 Comments
John Jimmy
on 20 May 2020
Walter Roberson
on 20 May 2020
It worked for me in my test:
org = imresize(imread('cameraman.tif'), [100 100]);
subplot(2,1,1), imshow(org), title('Org. Img.');
subplot(2,1,2), imhist(org),title('Histogram of original image'), axis([0 270 0 8500]);
(The histogram for this test is not empty; the counts are just not nearly as much as the 8500 you set as the axis limits)
John Jimmy
on 20 May 2020
John Jimmy
on 20 May 2020
Edited: John Jimmy
on 20 May 2020
Answers (0)
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!