- 积分
- 5118
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-10-31
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近学习NCL,想画华南地区站点分布图。但是用NCL画出来之后,不能屏蔽别的省份,这个要怎么修改呢?
我看论坛里面说用res@mpMaskAreaSpecifiers 设置就可以只画出想要的地区,为什么我设置了没有用呢?
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
f=asciiread("/cygdrive/e/fnl/huananzhandian.txt",(/84,3/),"float")
y=new((/84/),"float")
x=new((/84/),"float")
y(:)=f(:,1)
x(:)=f(:,2)
wks=gsn_open_wks("png","/cygdrive/e/fnl/35")
gsn_define_colormap( wks ,"gui_default")
res = True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;>--------------------------------------------<
; set for the map
;>--------------------------------------------<
res@mpMinLatF = 20.
res@mpMaxLatF = 30.
res@mpMinLonF = 104.
res@mpMaxLonF = 120.
res@mpFillOn = True
res@mpOutlineOn = False ; Use outlines from shapefile
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpAreaMaskingOn = True
res@mpMaskAreaSpecifiers = (/"Guandong","Guangxi","Fujian","Jiangxi","Hunan","Guizhou"/) 要画着几个省份
res@mpLandFillColor = "white"
res@mpInlandWaterFillColor = "white"
res@mpOceanFillColor = "white"
res@mpOutlineBoundarySets = "NoBoundaries"
map=gsn_csm_map(wks, res)
mkres=True
mkres@gsMarkerIndex=2
mkres@gsMarkerSizeF=0.02
mkres@gsMarkerColor="Blue"
gsn_polymarker(wks, map, x, y, mkres)
;>============================================================<
; add China map
;>------------------------------------------------------------<
cnres = True
cnres@china = True ;draw china map or not
cnres@river = False ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = False ;draw nanhai or not
cnres@diqu = False ; draw diqujie or not
chinamap = add_china_map(wks,map,cnres)
;>============================================================<
draw(map)
frame(wks)
end
|
|