How do I add a label on each bar of a multiple bar chart? I want to add specific times as labels.

조회 수: 2 (최근 30일)
I want to add a time as a label for each of my bars on this multiple bar chart. For example, I want 4:30:00 to display on top of my bar etc... Can someone help? Thanks.
figure(30)
h1=bar(T_Smooth{1:4,8},[T_Smooth{1,5} T_Smooth{1,7}; T_Smooth{2,5} T_Smooth{2,7};T_Smooth{3,5} T_Smooth{3,7};T_Smooth{4,5} T_Smooth{4,7}]);
I get this figure:

답변 (2개)

Cris LaPierre
Cris LaPierre 2021년 8월 6일
See the 'Specify Labels at the Ends of Bars' example on the bar documentation page.

Peter Perkins
Peter Perkins 2021년 8월 6일
I bet there's a way to simplify the arguments to your bar command. What about something like
bar(T_Smooth.X(1:4),T_Smooth{1:4,["Y" "Z"]})

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by