如何在matlab时间序列中X轴标注月-日

一般我们使用的时间序列都是以年为单位,比如下图:

而如果要绘制月尺度的时间变化图,则需要调整X轴的标注。下面代码展示了如何绘制小时尺度的降水数据。

sname2,lon2,lat2\] = kml2xy('GZ_.kml'); nc_bound2 = \[lon2,lat2\]; area_ind2=inpolygon(era_tp.lon,era_tp.lat,nc_bound2(:,1),nc_bound2(:,2)); %% region area area_scale=cal_grid_region(era_tp); GZ_rg = zeros(size(era_tp.rg,3),1); GZ_tt = GZ_rg; for ii=1:size(era_tp.rg,3) GZ_rg(ii)=sum(sum((era_tp.rg(:,:,ii).\*area_ind2.\*... area_scale))/sum(sum(area_ind2.\*area_scale))); GZ_tt(ii)=era_tp.tt(ii,1); disp(ii) end ttime = datenum(era_tp.tt(:,2:end)); plot(ttime,GZ_rg\*1000,'-') datetick('x','mm-dd') xlabel('Date') ylabel('Hourly precipitation/mm') title('ERA5')

下面是运行结果:

❤️欢迎点赞收藏❤️

相关推荐
郑州光合科技余经理3 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
feifeigo1233 天前
matlab画图工具
开发语言·matlab
西岸行者3 天前
学习笔记:SKILLS 能帮助更好的vibe coding
笔记·学习
dustcell.3 天前
haproxy七层代理
java·开发语言·前端
norlan_jame3 天前
C-PHY与D-PHY差异
c语言·开发语言
多恩Stone3 天前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc
QQ4022054963 天前
Python+django+vue3预制菜半成品配菜平台
开发语言·python·django
遥遥江上月3 天前
Node.js + Stagehand + Python 部署
开发语言·python·node.js
悠哉悠哉愿意3 天前
【单片机学习笔记】串口、超声波、NE555的同时使用
笔记·单片机·学习
m0_531237173 天前
C语言-数组练习进阶
c语言·开发语言·算法