登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在画Ekman螺线时,ncl默认的图X轴总是处于y=-1的地方,无法穿过最后的那个小弯弯。最后通过分为两步在同一帧叠加两个不同的图,可实现调整X轴往上到y=0出穿过小弯弯。脚本及最后结果图(粗略)如下:load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
u=new(1256,float)
v=new(1256,float)
i=fspan(0,12.55,1256)
u=1-exp(-i)*cos(i)
v=exp(-i)*sin(i)
wks=gsn_open_wks("pdf","ekman")
res = True
res@tiMainString = "EkmanSpiral"
;----first step----
res@trYMaxF = 1.0
res@trYMinF = 0.0
;-------Turn off left,right,top axes---
res@tmXTBorderOn = False
res@tmXTOn = False
res@tmYRBorderOn = False
res@tmYROn = False
res@tmYLBorderOn = False
res@tmYLOn = False
res@gsnFrame = False
;------plot x-axes and set to right position----
u1=fspan(0,0,100)
v1=fspan(0,1.2,100)
res@vpYF = 0.855 ;critical
res@tmXBMinorPerMajor = 3
plot1=gsn_xy(wks,v1,u1,res)
;--------second step---------
u@long_name = "u"
v@long_name = "v"
res1 = True
res1@trYMaxF = 1.0
;-------Turn off right,top,bottom axes----
res1@tmXTBorderOn = False
res1@tmXTOn = False
res1@tmXBBorderOn = False
res1@tmXBOn = False
res1@tmYRBorderOn = False
res1@tmYROn = False
plot2=gsn_xy(wks,u,v,res1)
frame(wks)
end
|