Move bars so that first is between 0 and 1 (0 and first tick) .

8 ビュー (過去 30 日間)
Rudolf
Rudolf 2021 年 5 月 3 日
編集済み: Adam Danz 2021 年 5 月 4 日
How can i move the bars 0.5 to the left (according xticks)?
I need first bar to be between 0 and 1, next from 1 to 2 and so on. Now the xticks are centered under each bar.

採用された回答

Adam Danz
Adam Danz 2021 年 5 月 3 日
編集済み: Adam Danz 2021 年 5 月 3 日
That looks like a histogram rather than a bar plot. You can define the histogram edges using (0:25)-.5 to shift the bars leftward by 0.5 units and centered on intergers.
If you are using a bar plot, set the x values to 0:23
  4 件のコメント
Rudolf
Rudolf 2021 年 5 月 4 日
Thank you very much. In this way i get the figure to look like wanted for a report we're making.
Is it the lack of any number behind 'BinCounts' which makes this work (like a bar plot)?
Adam Danz
Adam Danz 2021 年 5 月 4 日
編集済み: Adam Danz 2021 年 5 月 4 日
> Is it the lack of any number behind 'BinCounts' which makes this work
By specifying the bincounts, you're telling Matlab how high to make the bars which is similar to bar plot. It accepts floating point values, too, not just integer "counts".

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by