plot bar graph where each bar represents a range on the x axis?

1 回表示 (過去 30 日間)
tombola
tombola 2012 年 1 月 3 日
Hi,
Is it possible to plot a bar graph where each bar is given a range of x axis values.
Either that or each bar begins at a "start" value on the x axis.
So, rather than having a bar graph looking like: bar(1:10) Instead, the first bar will span 0 to 1, the second from 1 to 2 etc.
Is this possible? Drop me a line if I haven't explained it clearly enough.
Thanks for any help,
Tom
  1 件のコメント
the cyclist
the cyclist 2012 年 1 月 3 日
You haven't explained it clearly enough. :-)

サインインしてコメントする。

採用された回答

Andrew Newell
Andrew Newell 2012 年 1 月 3 日
I think what you're after is
hist(x,xbins)
where x is the data vector and xbins is a vector containing the center of each bar you want. For your example, xbins=0.5:1:9.5.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by