how to add numbers above the tips of a bar chart
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an array
b=[ 1 2 3]
then i use bar(b)
now how can i write the value of each bar (so the elements of the array) over each bar.
댓글 수: 0
채택된 답변
Rik
2022년 1월 9일
b=[1 2 3];
labels=arrayfun(@num2str,b,'Uni',0);
bar(b)
text(1:numel(b),b+0.1,labels)
댓글 수: 4
Rik
2022년 1월 10일
The documentation of the axes properties states the following:
The font size affects the title, axis labels, and tick labels.
So to adjust the tick label font you will have to change the axes font size.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!