Auto adjust y axis with imhist

조회 수: 11 (최근 30일)
Askic V
Askic V 2022년 5월 23일
답변: Chunru 2022년 5월 23일
Hello, I'm having problem with autoscale of y axis when plotting histogram of an image intensities.
for example, the following code:
img = imread('cameraman.tif');
subplot(2,3,1)
image(img)
colormap('gray')
subplot(2,3,2)
imhist(img);
produces the output like shown in the attached picture.
A you can see, the values go beyound the upper limit on the plot.

채택된 답변

Chunru
Chunru 2022년 5월 23일
img = imread('cameraman.tif');
subplot(2,3,1)
image(img)
colormap('gray')
subplot(2,3,2)
imhist(img);
ylim auto

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by