- 积分
- 7106
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-7-22
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我想画一个大的区域图 ,再从大区域中选出三个小区域,然后分别画在大图旁边。
但是脚本总算出错,各位帮忙看看吧
begin
wks = gsn_open_wks("pdf","lake-location")
dir = "/HOME/nwafu_climate_3/WORKSPACE/zqh/cesm121/run/TPlake/run/"
filename = "TPlake.clm2.h0.2003.nc"
a = addfile(dir+filename,"r")
th = a->TLAKE
tlake = th*0.
copy_VarCoords(th,tlake)
shp_f = "/HOME/nwafu_climate_3/WORKSPACE/zqh/cesm121/tp/tibetan.shp"
th_mask = shapefile_mask_data(tlake(0,0,:,:),shp_f,True)
gsn_define_colormap(wks,"BlRe")
res = True
res@gsnAddCyclic = False
res@gsnDraw = False
res@gsnFrame = False
res@gsnMaximize = True
res@cnFillOn = True
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@mpGeophysicalLineColor = "Black"
res@mpNationalLineColor = "Black"
res@mpLimbLineColor = "Black"
res@mpPerimLineColor = "Black"
res@mpUSStateLineColor = False
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
res@mpGeophysicalLineThicknessF = 5
res@gsLineThicknessF = 5
res@mpLimitMode = "LatLon"
res@pmTickMarkDisplayMode = "Always"
res@lbLabelAutoStride = True
res@lbBoxLinesOn = False
res@lbLabelBarOn = False
res@cnInfoLabelOn = False
res@cnLevelSelectionMode ="ManualLevels"
res@cnMinLevelValF = 0
res@cnMaxLevelValF = 1
res@cnLevelSpacingF = 1
res@gsnSpreadColorStart = 12
res@gsnSpreadColorEnd = 13
res@gsnLeftString = ""
res@gsnRightString = ""
res@gsnCenterString = ""
res@gsnCenterString = ""
res@vpWidthF = 0.4 ; Make plots small enough to fit in
res@vpHeightF = 0.4 ; unit square. Aspect ratio is preserved.
plot = gsn_csm_contour_map(wks,th(0,0,:,:),res)
;---Create map plot
base_map = gsn_csm_map_ce(wks,res)
shpfn1="/HOME/nwafu_climate_3/WORKSPACE/zqh/cesm121/tp/qh.shp"
qhres = True
qhres@mpGeophysicalLineThicknessF = 3
qhres@gsLineThicknessF = 3
qhres@mpMinLatF = 36.5
qhres@mpMinLonF = 99.5
qhres@mpMaxLatF = 37.35
qhres@mpMaxLonF = 100.8
map1 = gsn_csm_map(wks,qhres)
shp_plot1 = gsn_add_shapefile_polygons(wks,map1,shpfn1,qhres)
shpfn2="/HOME/nwafu_climate_3/WORKSPACE/zqh/cesm121/tp/zhaling.shp"
zlres = True
zlres@mpGeophysicalLineThicknessF = 3
zlres@gsLineThicknessF = 3
zlres@mpMinLatF = 34.75
zlres@mpMinLonF = 97
zlres@mpMaxLatF = 35.1
zlres@mpMaxLonF = 97.55
map2 = gsn_csm_map(wks,zlres)
shp_plot2 = gsn_add_shapefile_polylines(wks,map2,shpfn2,zlres)
shpfn3="/HOME/nwafu_climate_3/WORKSPACE/zqh/cesm121/tp/naco20131129.shp"
nmres = True
nmres@mpGeophysicalLineThicknessF = 3
nmres@gsLineThicknessF = 3
nmres@mpMinLatF = 30.45
nmres@mpMinLonF = 90.2
nmres@mpMaxLatF = 31
nmres@mpMaxLonF = 91.1
map3 = gsn_csm_map(wks,nmres)
shp_plot3 = gsn_add_shapefile_polylines(wks,map3,shpfn3,nmres)
;---Resources for adding 1,2plots to base_map.
ares = True
ares@amJust = "TopRight"
amid1 = gsn_add_annotation(base_map,shp_plot1,ares)
bres = True
bres@amJust = "BottomRight"
amid2 = gsn_add_annotation(base_map,shp_plot2,bres)
;---Attach third plot
cres = True
ares@amJust = "TopLeft"
amid3 = gsn_add_annotation(base_map,shp_plot3,cres)
;---This will draw everything, but it won't be maximized in frame.
draw(base_map)
frame(wks)
;
; maximize_output will resize graphics to maximize them
; on the page. This only works for PDF/PS output.
;
pres = True
pres@gsnMaximize = True
maximize_output(wks,pres)
end
|
|