- 积分
- 11523
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-8-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近,闲得慌绘制了一下我们的祖国和Nino区域,供大家作为底图使用,程序我贴出来了。
官网上可是没有的,欢迎大家使用啊!!!
分享总是快乐的。
;Written by Rao Jian for all of you
;2012.10.21
;================================================;
; Concepts illustrated:
; - Changing the color of the oceans, land, and inland water areas
; - draw the border of the mainland of China
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/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
; ================================================;
begin
wks = gsn_open_wks("ps","map") ; open a ps file
gsn_define_colormap(wks,"wh-bl-gr-ye-re") ; choose a colormap
res = True ; mods desdired
res@gsnDraw = False ; don't draw yet
res@gsnFrame = False ; don't advance yet
res@mpOceanFillColor = 5 ; array index in color map
res@mpLandFillColor = 164 ; for land, ocean, and inland h20
res@mpInlandWaterFillColor = 54
res@mpDataBaseVersion = "Ncarg4_1"
res@mpDataSetName = "Earth..4"
res@mpOutlineOn = True
; res@mpOutlineSpecifiers = (/"China:states","Taiwan","Land:Eurasia"/)
res@mpOutlineBoundarySets = "National" ; or "NoBoundaries"
res@mpAreaMaskingOn = True
; res@mpFillOn = False
res@mpGeophysicalLineColor = 17 ;"Navy" ; color of cont. outlines
res@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines
; res@mpMinLonF = 120
; res@mpMaxLonF = 300
res@mpCenterLonF = 160 ; This is necessary to get the correct map
; res@mpMinLatF = -20
; res@mpMaxLatF = 20
plot = gsn_csm_map_ce(wks,res) ; draw global map
;************************************************
; create points for box
;************************************************
ypts = (/ -5.0, 5.0, 5.0, -5.0, -5.0/)
xpts = (/-150.0, -150.0, -90.0, -90.0,-150.0/)
;************************************************
; add the box
;************************************************
resp = True ; polyline mods desired
resp@gsLineColor = "red" ; color of lines
;resp@gsLineThicknessF = 2.0 ; thickness of lines
;resp@gsLineLabelString= "Nino3" ; adds a line label string
; create array of dummy graphic variables. This is required, b/c each line
; must be associated with a unique dummy variable.
dum1 = new(4,graphic)
dum2 = new(4,graphic)
dum3 = new(4,graphic)
dum4 = new(4,graphic)
; resp@mpFillDrawOrder = "PreDraw"
resp@gsFillIndex = 17
resp@gsFillColor = "purple"
do i = 0,3
dum1(i)=gsn_add_polyline(wks,plot,xpts,ypts,resp)
end do
resp@gsFillIndex = 17
resp@gsFillColor = "navy"
resp@gsLineColor = "navy"
ypts = (/ -5.0, 5.0, 5.0, -5.0, -5.0/)
xpts = (/160, 160, 210, 210, 160/)
do i = 0,3
dum2(i)=gsn_add_polyline(wks,plot,xpts,ypts,resp)
end do
ypts = (/ -5.0, 5.0, 5.0, -5.0, -5.0/)
xpts = (/-170, -170, -120, -120, -170/)
resp@gsFillScaleF = 0.75
resp@gsFillColor = "gray"
resp@gsLineColor = "gray"
do i = 0,3
dum3(i)=gsn_add_polyline(wks,plot,xpts,ypts,resp)
end do
ypts = (/ -10, 0.0, 0.0, -10, -10/)
xpts = (/-90, -90, -80, -80, -90/)
resp@gsFillScaleF = 1.0 ; Default
resp@gsFillColor = "forestgreen"
resp@gsLineColor = "forestgreen"
do i = 0,3
dum4(i)=gsn_add_polyline(wks,plot,xpts,ypts,resp)
end do
draw(plot)
;************************************************
; label the box with additional text
;************************************************
tres = True
tres@txFontHeightF = 0.010
tres@mpFillDrawOrder = "PostDraw"
gsn_text(wks,plot,"Nino3",-120,0.0,tres)
gsn_text(wks,plot,"Nino4",185.,0.0,tres)
gsn_text(wks,plot,"Nino3.4",-145.,0.0,tres)
gsn_text(wks,plot,"Nino1+2",-85.,-5.,tres)
tres@txFontHeightF = 0.020
tres@txFontColor = 200
gsn_text(wks,plot,"C h i n a",105,35.,tres)
frame(wks)
maximize_output(wks,True)
end
+++++++++++++++++++++++++++++
效果是这样的,见图。
China
|
评分
-
查看全部评分
|