Why does my histogram go out of its frame?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I draw a histogram from an image using imhist just like this:
subplot(2, 2, 3), imhist(a+50), title("Blob1 lighter hist");
and then when I plot it, the lines are getting out of the frame and I don't know why.
Please someone help me, I really don't understand what is going on with my Matlab program and I don't find anything online.
2 commentaires
Cris LaPierre
le 13 Mai 2023
%% Blobs
figure;
a = imread("blobs1.png");
b = imread("blobs2.png");
c = imread("blobs3.png");
d = imread("blobs4.png");
subplot(2, 2, 1), imshow(a), title("Blob1");
subplot(2, 2, 2), imshow(b), title("Blob2");
subplot(2, 2, 3), imshow(c), title("Blob3");
subplot(2, 2, 4), imshow(d), title("Blob4");
figure;
subplot(2, 2, 1), imhist(a), title("Blob1");
subplot(2, 2, 2), imhist(b), title("Blob2");
subplot(2, 2, 3), imhist(c), title("Blob3");
subplot(2, 2, 4), imhist(d), title("Blob4");
disp('Blob1');
mean(a(:));
std(double(a(:)));
disp('Blob2');
mean(b(:));
std(double(b(:)));
disp('Blob3');
mean(c(:));
std(double(c(:)));
disp('Blob4');
mean(d(:));
std(double(d(:)));
Réponses (3)
Cris LaPierre
le 13 Mai 2023
I'm able to reproduce as well. I suggest reporting this here: https://www.mathworks.com/support/contact_us.html
0 commentaires
Cris LaPierre
le 16 Mai 2023
Modifié(e) : Cris LaPierre
le 16 Mai 2023
I would recommend not using imhist to create your histogram. Instead, use histogram(I) or bar(counts) to visualize.
B1 = imread('blobs1.png');
figure
histogram(B1,'BinWidth',1)
xlim([0,255])
figure
counts = imhist(B1);
bar(counts)
0 commentaires
Image Analyst
le 16 Mai 2023
I am not able to reproduce in either R2022b or R2023a. It looks perfectly fine. I'd call tech support. Maybe try a different renderer with opengl
1 commentaire
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!