필터 지우기
필터 지우기

How to make barh figure have minimum value of vertical axis zero?

조회 수: 2 (최근 30일)
farzad
farzad 2020년 4월 28일
댓글: Adam Danz 2020년 4월 28일
Hi All
I was trying to force the barh figure to always have 0 as minimum
ranged = ranges(0 < ranges & ranges < max(ranges)*1.1)
but doing so, if the minimum is too close to zero but positive, the minimum of the plot will be a negative value. since for my parameter on vertical axis , negative value has no meaning, I wanted to have it always positive, even Ylim did not work. any suggestion ?
  댓글 수: 1
Adam Danz
Adam Danz 2020년 4월 28일
Wait, I'm confused. barh produces horizontal bars. What do you mean by "minimum balue of vertical axis"? What is ranges? Perhaps a screenshot would be helpful.

댓글을 달려면 로그인하십시오.

채택된 답변

Adam Danz
Adam Danz 2020년 4월 28일
Assuming, ranges is a matrix or vector identifying the bar hight of each bar,
ranged = max(0, ranges);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by