Changing X-Axis to Hours

조회 수: 5 (최근 30일)
Shelby Fabian
Shelby Fabian 2016년 12월 6일
댓글: Shelby Fabian 2016년 12월 6일
I am trying to plot a temperature function for 48 hours, but I want the axis to read "12:00 AM", "1:00 AM", "2:00 AM", etc. for the 2 day cycle. I've tried a bunch of things but I can't get it to actually add an hour each time and print them as the axis labels. Any suggestions? Thanks!

채택된 답변

Preethi
Preethi 2016년 12월 6일
hi,
You can use XTickLabel, for example
set(gca,'XTickLabel',{'1:00AM','2:00AM','3:00AM','4:00AM','5:00AM','6:00AM'})
  댓글 수: 1
Shelby Fabian
Shelby Fabian 2016년 12월 6일
Thank you so much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by