Properly scale histogram in subplot and error handling
4 次查看(过去 30 天)
显示 更早的评论
Hey there,
when I am trying to subplot an image and its histogram the histogram is stretched too far in vertical space. I am also getting the following error code:
% Error using imageDisplayValidateParams
% Expected input number 1, I, to be one of these types:
% numeric, logical
% Instead its type was matlab.graphics.chart.primitive.Histogram.
The code I am using is the following and this should be reproduceable with any image I think:
IMG = imread('img.tif');
subplot(1,2,1); imshow(IMG);
subplot(1,2,2); imshow(histogram(IMG));
Does someone know how to fix this error and how to properly resize the histogram?
Thank you in advance!
0 个评论
采纳的回答
KALYAN ACHARJYA
2019-12-6
IMG = imread('img.tif');
subplot(1,2,1); imshow(IMG);
subplot(1,2,2); histogram(IMG);
3 个评论
KALYAN ACHARJYA
2019-12-6
IMG = imread('img.tif');
subplot(2,1,1); imshow(IMG);
subplot(2,1,2); histogram(IMG);
Image Analyst
2019-12-6
The axes autosize according to the figure width. You can click and drag the figure edge to resize it until the histogram size matches the image size.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!