Hello Mathwork's community.
I'm trying to plot an histogram of a vector and I'm getting the following figure:
It's been coded so that there are 30 bins. The thing is that I would like the first been to only represent the 0 values and afterwards keep representing those bin edges, but as you can see on the picture, the first bin goes from 0 to 10.4. I've been doing some research but still can't figure it out.
I'd really appreciate if someone could give me a hand.
Thank you,
Santos

답변 (1개)

Star Strider
Star Strider 2021년 3월 15일

0 개 추천

The histogram function allows you to specify whatever bin edges you want. See Specify Bin Edges of Histogram for details.

댓글 수: 4

Santos García Rosado
Santos García Rosado 2021년 3월 15일
Thank's for the quick answer. I read the documentation you provided and still can't get to make my histogram looking rigth. I did change the Specific Bin Edges and now my histogram looks like this:
Is there a way to change the y axes properties, so there is one for the first bin and a second one for the rest of them in order to have a better visualization?
Thank you,
Santos
Star Strider
Star Strider 2021년 3월 15일
Is there a way to change the y axes properties, so there is one for the first bin and a second one for the rest of them in order to have a better visualization?
I am not certain what you want to change.
With respect to the ticks themselves, use the appropriate XTick, YTick, XTickLabel and YTickLabel options in the Ticks properties to change them and their labels.
However you may want to change the axis scaling instead. See the documentation section on NumericRuler Properties to do that.
Santos García Rosado
Santos García Rosado 2021년 3월 16일
I finally ended up finding a solution. I used de yyaxis left and yyaxis right to do the trick. Thank's anyway
Star Strider
Star Strider 2021년 3월 16일
That is not a solution I would suggest for a histogram plot.

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

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 3월 15일

댓글:

2021년 3월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by