필터 지우기
필터 지우기

A simple question regarding axes label

조회 수: 1 (최근 30일)
Fred
Fred 2012년 12월 27일
I am plotting a time series 12 months*10 years=120 values and my default x axis label is from 1 to 120 but I want change the label of first month of each year: 1 to 2000, 13 to 2001, 25 to 2002 and so on. I know it has to do with Ticks, but I dont know how to write the code Thanks

채택된 답변

Wayne King
Wayne King 2012년 12월 27일
편집: Wayne King 2012년 12월 27일
You can first set up the xticks to match exactly the beginning of the years and then set the xticklabel property to match the years
x = randn(120,1);
plot(x)
set(gca,'xtick',1:13:120);
set(gca,'xticklabel',2000:2009);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by