plotting data from two years with day of year replacing julian date
古いコメントを表示
I have the following code for producing a plot of data that extends two years in terms of day of year:
time = datenum('2008-04-17 02:00'):datenum('2009-11-24 12:27');
dateV = datevec(time);
for i = 1:length(time);
DOY(i) = time(i) - datenum(dateV(i,1),0,0);
end
data = rand(length(time),1);
plot(time,data);
set(gca,'XTick',floor(time(1:50:end))','XTickLabel',floor(DOY(1:50:end)))
Could someone suggest a method for ensuring the ticks on the xaxis are for day numbers that are multiples of 10 i.e. 110, 160 etc.
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2012 年 9 月 14 日
close
time = datenum('2008-04-17 02:00'):datenum('2009-11-24 12:27');
dateV = datevec(time);
for i = 1:length(time);
DOY(i) = time(i) - datenum(dateV(i,1),0,0);
end
data = rand(length(time),1);
n=length(time)
plot(1:n,data);
set(gca,'XTick',10:50:n)
5 件のコメント
Richard
2012 年 9 月 14 日
Azzi Abdelmalek
2012 年 9 月 14 日
what do you want exactly on x axis
Richard
2012 年 9 月 14 日
Azzi Abdelmalek
2012 年 9 月 14 日
when you say 200, compared to what, what is your mark? how can we know that is 200, then we can fix our code
Richard
2012 年 9 月 15 日
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!