- 积分
- 13339
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-10-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
关于南海区域作图的颜色和大陆地区不同的情况我之前已经发问了,并且在下面的链接中得到解决http://bbs.06climate.com/forum.php?mod=viewthread&tid=93697但是现在又出新状况了呜呜呜,同一个问题,上次的办法不管用了。代码就是兰溪大神的代码,几乎没有改动,不知道为啥现在又不行了
-----------下面是代码----------
f=addfile("CN05.1_SPEI_1961_2017_month_025x025.nc","r")
spei= f->SPEI12(301:540,:,:)
SPEI=dim_avg_n_Wrap(spei,0)
;---------------------------------------------------------------
wks = gsn_open_wks("png","SPEI_ave_1986-2005")
cmap = read_colormap_file("NCV_blue_red")
res = True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnAddCyclic = False ; plotted dataa are not cyclic
res@cnFillPalette = cmap(30:,:)
;---------------------------------------------------------------
; set for the map
res@mpMinLatF = 0.
res@mpMaxLatF = 55.
res@mpMinLonF = 72.
res@mpMaxLonF = 136.
res@mpFillOn = True
res@mpDataSetName = "./database/Earth..4"
res@mpDataBaseVersion = "MediumRes" ; or "Ncarg4_1"
res@mpAreaMaskingOn = True
res@mpMaskAreaSpecifiers = (/"China"/)
res@mpOutlineSpecifiers = (/"China","China:Provinces"/)
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
res@mpFillBoundarySets = "NoBoundaries"
res@mpOutlineBoundarySets = "NoBoundaries"
res@mpNationalLineColor = "black"
res@mpProvincialLineColor = "black"
res@mpGeophysicalLineColor = "black"
res@mpNationalLineThicknessF = 2
res@mpProvincialLineThicknessF = 1
;---------------------------------------------------------------
; set for the plot
res@cnFillOn = True
res@cnFillDrawOrder = "PreDraw"
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = fspan(-1,1,11)
res@lbLabelAutoStride = True
res@pmTickMarkDisplayMode = "Always"
;---------------------------------------------------------------
; plot one part of China map with South China Sea subplot
res@mpMinLatF = 17.
res@gsnLeftString = "SPEI"
map1 = gsn_csm_contour_map(wks,SPEI,res)
;--- add South China Sea ---
nhres = True
nhres@gsnFrame = False
nhres@gsnDraw = False
nhres@gsnAddCyclic = False
nhres@vpHeightF = 0.18
nhres@vpWidthF = 0.18
nhres@mpMinLatF = 2.0
nhres@mpMaxLatF = 23.0
nhres@mpMinLonF = 105.0
nhres@mpMaxLonF = 123.0
getvalues map1
"mpDataSetName" : nhres@mpDataSetName
"mpDataBaseVersion" : nhres@mpDataBaseVersion
"mpFillOn" : nhres@mpFillOn
"mpFillDrawOrder" : nhres@mpFillDrawOrder
"mpAreaMaskingOn" : nhres@mpAreaMaskingOn
"mpMaskAreaSpecifiers" : nhres@mpMaskAreaSpecifiers
"mpOutlineSpecifiers" : nhres@mpOutlineSpecifiers
"mpOutlineBoundarySets" : nhres@mpOutlineBoundarySets
"mpLandFillColor" : nhres@mpLandFillColor
"mpOceanFillColor" : nhres@mpOceanFillColor
"mpInlandWaterFillColor" : nhres@mpInlandWaterFillColor
"mpNationalLineColor" : nhres@mpNationalLineColor
"mpProvincialLineColor" : nhres@mpProvincialLineColor
end getvalues
getvalues map1@contour
"cnFillOn" : nhres@cnFillOn
"cnLevelSelectionMode" : nhres@cnLevelSelectionMode
"cnLevels" : nhres@cnLevels
"cnFillColors" : nhres@cnFillColors
"cnFillDrawOrder" : nhres@cnFillDrawOrder
"cnLinesOn" : nhres@cnLinesOn
"cnLineLabelsOn" : nhres@cnLineLabelsOn
end getvalues
nhres@lbLabelBarOn = False
nhres@tmXBOn = False
nhres@tmYLOn = False
nhres@tmYROn = False
nhres@tmXTOn = False
nhres@gsnLeftString = ""
nhres@gsnRightString = ""
map_nanhai = gsn_csm_contour_map(wks,SPEI,nhres)
adres = True
adres@amParallelPosF = 0.5 ; -0.5 is the left edge of the plot.
adres@amOrthogonalPosF = 0.5 ; -0.5 is the top edge of the plot.
adres@amJust = "BottomRight"
plotnh = gsn_add_annotation(map1,map_nanhai,adres)
draw(map1)
frame(wks)
|
|