- 积分
- 757
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-12-30
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
因为绘图数量较多,因此采用一个循环批量出图。
在overlay位势高度场和温度场时,虽然利用循环进行overlay,且在"x11"模式下可以看到每次overlay的结果,但是生成png文件时仅有最后一张overlay显示出来,请问是什么原因,该如何修改?请大神指教!
代码如下:
begin
a = addfile("Basicmean_field.nc","r")
gh = a->PH
t = a->T
wks = gsn_open_wks("png","test_L41_")
=============位势高度场设置====================
res = True
res@cnFillOn = True
res@cnLinesOn = False
res@lbLabelBarOn = True
res@cnFillPalette = "BlAqGrYeOrReVi200"
res@gsnLeftString = "Geopotential height & Potential temperature"
res@gsnRightString = ""
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
nplots = 2
level = 41
plots = new(nplots,graphic)
do i=0,nplots-1
plots(i) = gsn_csm_contour(wks,gh(i,level,:,:),res)
end do
=========温度场设置==================
tres = True
tres@cnFillOn = False
tres@lbLabelBarOn = False
tres@cnLevelSpacingF = 4.
tres@cnLineLabelsOn = True
tres@cnLineThicknessF = 4.
tres@cnLineColors = "red"
tres@gsnLeftString = " "
tres@gsnRightString = " "
tres@cnMonoLineDashPattern = True
tres@cnLineDashPattern = 1
tres@gsnDraw = False
tplots = new(nplots,graphic)
do i=0,nplots-1
tplots(i) = gsn_csm_contour(wks,t(i,level,:,:),tres)
end do
============循环overlay===================
do i=0,nplots-1
overlay(plots(i),tplots(i))
end do
draw(plots)
frame(wks)
end
|
|