How to plot the my timeseries so I have 12 plots (1 for each month) and years on the x axis with sst on the y axis?

조회 수: 1 (최근 30일)
I'm trying to plot the the average sst for every month from 01-Jan-1984 to 01-Dec-2014 over the lat and lon specified in the code. Please help me make the code to make the acutal plot for each month (12 plots total). sst.mnmean.nc

답변 (1개)

Elizabeth Reese
Elizabeth Reese 2017년 12월 7일
Just to rephrase, you are averaging sst over the dimensions for lat and lon within a certain range. Then create 12 plots for those averages changing year to year for a given month.
It looks like you are using times 26:386 instead of over all 431 timesteps in this data.
So, we can create a datetime array of those times.
ts = datetime(outtime_string(26:386,:));
Then loop through the months and create the plots.
for i=1:12
figure;
plot(ts.Year(ts.Month == i), sst_timeseries(ts.Month == i))
title(['Month ' num2str(i)])
end
  댓글 수: 1
Lauren Arvai
Lauren Arvai 2017년 12월 7일
Does this code contain the loop also? I've been learning to code on my own so I'm not super knowledgeable in this area.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by