Grid to time and Grid to lon/lat conversion
6 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have rotated the current grid and then plot. But the plot is giving on grid for both axis. How can I show (lat,lon) on y axis and time on x axis.
I tried to use datetick; but it's giving wrong date.
(As the grid is rotated; everything is calculated acordingly. Also because of grid rotation there should be lat and lon both on y axis.)
[NTR NIR]=size(UTR);
[NTR NIR]=meshgrid(1:NIR,1:NTR);
figure(4); clf; quiver(NIR,NTR,UTR,VTR,1,'k')
% set(gca,'xlim',[ min(TIMEw) max(TIMEw)])
datetick('x','mm/dd/yy','keeplimits','keepticks')
1 件のコメント
Walter Roberson
2020 年 10 月 20 日
It is not clear that it makes sense to display a time axes in that plot. Your X and Y are NIR and NTR which go up to about 320 and 55 respectively. Is the 320 intended to be days? If so then for mm/dd/yy to be meaningful there would need to be a base date to start from.
回答 (1 件)
Tanziha Mahjabin
2020 年 10 月 21 日
3 件のコメント
dpb
2020 年 10 月 21 日
time=ncread(fileIn, 'TIME');
reftime=ncreadatt(fileIn,'TIME','units'); reftime=reftime(12:end-4);
reftime=datenum(reftime,'yyyy-mm-dd HH:MM:SS');
time=time+reftime;
Don't use deprecated datenum, use datetime instead. Then plot routines are datetime aware and you'll get time axes automagically if using a datetime variable as the abscissa.
If the time is some number of time units from a reference, it will be a duration added to the reference datetime
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!