How to make a square Histogram plot with the same range of values over x axis
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163423/image.png)
figure(1);
clf;
for i = 1:size(wint2_r,3)
tmpwint2_r = squeeze(wint2_r(:,:,i));
tmpwint = tmpwint2_r(:);
subplot(2,6,i);
idx = tmpwint>0;
hist(tmpwint(idx),12);
N = hist(tmpwint(idx));
for j = 1:length(N)
tn(i,j) = N(j);
end
end
0 Kommentare
Antworten (1)
Chad Greene
am 13 Mai 2016
You're using
hist(tmpwint(idx),12);
which specifies 12 equally spaced bins over the range of values in tmpwint. If you want all histograms to have the same 12 bins do this
hist(tmpwint(idx),1:12)
to specify bins at 1, 2, 3,..., 12. Or do this
hist(tmpwint(idx),1:0.5:12)
to specify bins at 1, 1.5, 2, 2.5, ..., 12.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!