Auto adjust y axis with imhist

13 Ansichten (letzte 30 Tage)
Askic V
Askic V am 23 Mai 2022
Beantwortet: Chunru am 23 Mai 2022
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.

Akzeptierte Antwort

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

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by