我创建了以下直方图,并且分箱是对数的,但是我找不到使所有分箱的宽度相等的方法。我知道我必须将每个垃圾箱的频率除以宽度,但我真的做不到。
for j=500
if j<201
myTolerance = 1.e+2;
else
myTolerance = 2*1.e+3;
end
index1 = Wkinet_eV(:,j)>myTolerance;
new1 = Wkinet_eV(index1,j);
end
%nbins=35;
figure(1)
hold on
edge_min = log10(100);
edge_max = log10(1.04*1.e+8);
edges = logspace(edge_min,edge_max,35);
% [counts, edges1] = histcounts(new1,edges); THIS IS WHAT I'VE TRIED TO MAKE EQUAL WIDTH
% newedges = edges(1:end-1)./counts;
h = histogram(new1,edges,'Normalization','probability'); %IT SHOULD BE newedges not edges if we used the previous comments.
%h.XTickLabels=10.^(h.XTick);