问题
I want to change how data are distributed in the histogram that I built.My histogram looks like
But I want it to look like
I set
bins1=[10,30,50,70];
hist(data,bins1)
How can I arrange the bins as in the second figure?
回答1:
Use histc
instead of hist
. histc
allows you to define the edges while hist
uses the second input parameter as centers.
来源:https://stackoverflow.com/questions/29016872/matlab-bins-setting-in-histogram