Bar graph start value

조회 수: 27 (최근 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에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by