Bar graph start value

15 次查看(过去 30 天)
David C
David C 2011-9-7
Hi,
The bar command always draw bars starting from 0. If the value to plot is positive, the bar extends upwards from 0, and if the value is negative, the corresponding bar extends downward. Is there a way to change the value the bars start at? For example, I would like the bars to start at -5 (so that bars with values at -2, -1 extend upward).
Thanks, David

采纳的回答

Oleg Komarov
Oleg Komarov 2011-9-7
bar([-5 -2 2 4 5],'BaseValue',-5)
  2 个评论
David C
David C 2011-9-7
Perfect. Thanks Oleg. I should have looked in the barseries properties before asking this question.
Oleg Komarov
Oleg Komarov 2011-9-7
I didn't know either before you asked.

请先登录,再进行评论。

更多回答(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