Multiple rotated histograms on same plot

8 次查看(过去 30 天)
Hello, I have a vector y for each time step. That is, I have something like this (1,y1), (1,y2), (1,y3), (2,y1), (2,y2), (2,y3), (2,y4) .. . (10,y1),(10,y2)
What I would like to do is plot the time on the x axis (1,2,3....) and on the y axis a histogram for the values in y. The graph would look like many rotated histograms, one for each time. I don't want to do subplot, because it's easier to see the time evolution on one same plot.
If any one has any ideas, tips or hints I would be really really grateful.
Thank you,
Clara

采纳的回答

Walter Roberson
Walter Roberson 2011-7-28
bar() and barh() support a property named 'base' that might be what you need.
  1 个评论
Clara
Clara 2011-7-28
Thank you, it works....
a little example of what to do:
I normalize the histograms, and then displace them
x=linspace(minval+delta,maxval-delta,100);
figure
hold on
barh(x, histc(vec_valmod(1:sizeonemod),x)./max(histc(vec_valmod(1:sizeonemod),x)))
barh(x, 1.5+histc(vec_valmod(1:sizeonemod),x)./max(histc(vec_valmod(1:sizeonemod),x)),'BaseValue',1.5)
Thanks again!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by