How to display interval data on x axis in histogram plot (eg. 10-20, 20-30,...) ?
조회 수: 12 (최근 30일)
이전 댓글 표시
I want to plot the data for x axis readings as 10-20, 30-40, 50-60 upto 190-200 for the repsctive y axis values as below in MATLAB. I tried using xlim or XTick but its not showing up the x axis in interval format.
x_ax_data = [10-20, 30-40, 50-60, 70-80, 90-100]
y_ax_data = [0, 0, 200, 550, 920]
댓글 수: 0
답변 (1개)
Star Strider
2022년 8월 3일
편집: Star Strider
2022년 8월 3일
Try this —
x_ax_data = ["10-20", "30-40", "50-60", "70-80", "90-100"]; % Create String Vector
y_ax_data = [0, 0, 200, 550, 920];
figure
bar(y_ax_data)
xticklabels(x_ax_data)
.
댓글 수: 2
Star Strider
2022년 8월 3일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!