Bar plot or histograms

조회 수: 13 (최근 30일)
Thishan Dharshana Karandana Gamalathge
댓글: Rik 2017년 12월 14일
I have values for temperature rangers, for an example 10-20, 20-30, etc.When I make a bar plot, the x-axis just shows 1,2,3 etc. I want x-axis to show the range I consider, ie for the 1st bar;10-20, for the 2nd bar;20-30 etc. How can I do that? I have MATLAB_R2016a. Thanks.

답변 (1개)

Rik
Rik 2017년 11월 19일
Read the documentation. This will plot bars of height y at locations x:
bar(x,y)
If you want to change the text of the xticks, you can use xticklabels. You can make sure they are at the correct x-values by using xticks(x)
  댓글 수: 1
Rik
Rik 2017년 12월 14일
If you found this answer useful, please mark it as accepted answer. It will make it easier for other people with the same question to find an answer, as well as give me reputation points. If this didn't solve your question, please comment with what problems you are still having.

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

카테고리

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