- 积分
- 847
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-5-10
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
用panel画分图,已经在panel的设置中写了 presources@gsnPanelYWhiteSpacePercent = 0.0,可没有任何反应。
图之间的距离没有变化。先忽略我画的很丑的图,写得有点乱的程序。
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/cnmap/cnmap.ncl"
begin
f=addfile("prelev.nc","r")
wks = gsn_open_wks("png","panel2013900")
u=f->u(:,22,:,:)
v=f->v(:,22,:,:)
uu=sqrt(u*u+v*v)
t=short2flt(f->t(:,22,:,:))
hgt=short2flt(f->z(:,22,:,:))
hgt=hgt/9.8
t=t-273.15
t@units="(C)"
copy_VarMeta(u,uu)
lat=f->latitude
lon=f->longitude
printMinMax(t,False)
printMinMax(hgt,False)
printMinMax(uu,False)
ntime=12
temp=new(ntime,graphic)
hgt1=new(ntime,graphic)
vec=new(ntime,graphic)
;`````````````````````````````````````````````````````````````````````
;map
;`````````````````````````````````````````````````````````````````````
resources2=True
resources2@gsnDraw = False
resources2@gsnFrame = False
resources2@gsnRightString =""
resources2@gsnLeftString =""
; resources2@gsnMaximize =True
resources2@mpMinLatF = 10.
resources2@mpMaxLatF = 30.
resources2@mpMinLonF = 95.
resources2@mpMaxLonF = 125.
resources2@mpFillOn = False
resources2@mpOutlineOn = False ; Use outlines from shapefile
resources2@mpFillDrawOrder = "PostDraw"
resources2@mpDataBaseVersion = "MediumRes"
resources2@mpDataSetName = "Earth..4"
resources2@mpOutlineOn = True ; Turn on map outlines
resources2@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
;resources2@mpAreaMaskingOn = True ;cover it
;resources2@mpMaskAreaSpecifiers = (/"China","Taiwan"/) ;China:states
resources2@mpLandFillColor = "white"
resources2@mpInlandWaterFillColor = "white"
resources2@mpOceanFillColor = "white"
resources2@mpOutlineBoundarySets = "NoBoundaries"
; resources2@vpHeightF = 1.2
; resources2@vpWidthF = 0.4
; resources2@vpXF = 0.1
; resources2@vpYF = 0.9
;```````````````````````````````````````````````````````````````````
;contour
;```````````````````````````````````````````````````````````````````
resources2@cnFillOn = True
resources2@cnLinesOn = False
resources2@cnInfoLabelOn = False
resources2@cnLineLabelsOn = False
resources2@gsnSpreadColors = True
resources2@lbLabelAutoStride = True
resources2@lbLabelBarOn = False
gsn_define_colormap(wks,"wh-bl-gr-ye-re") ;temp
resources2@gsnAddCyclic = False ;not global
resources2@cnSmoothingOn = True
; resources2@cnLevelSelectionMode="ExplicitLevels"
; resources2@cnLevels = (/-30,-20,-10,0,10,20/)
resources2@cnLevelSelectionMode="AutomaticLevels"
resources2@tmYRLabelsOn = False ; no right labels
resources2@tmYROn = False
resources2@tmXTLabelsOn = False ; do not draw top labels
resources2@tmXTOn = False
resources2@tmXBLabelsOn = False ; no bottom labels
resources2@tmXBOn = False ; no bottom tickmarks
resources2@tmYLLabelsOn = False ; do not draw left labels
resources2@tmYLOn = False ; no left tickmarks
resources2@tmXBLabelFontHeightF = 0.04
resources2@tmYLLabelFontHeightF = 0.04
do i=0,11
;--Turn off various tickmarks and labels depend on which plot this is--
if (i .ge. 8) then
resources2@tmXBLabelsOn = True
resources2@tmXBOn = True
else
resources2@tmXBLabelsOn = False
resources2@tmXBOn = False
end if
if (i%4 .eq. 0) then
resources2@tmYLLabelsOn = True
resources2@tmYLOn = True
else
resources2@tmYLLabelsOn = False
resources2@tmYLOn = False
end if
; resources2@gsnMaximize = True
temp(i)=gsn_csm_contour_map(wks,t(i,:,:),resources2)
; delete(resources2)
;````````````````````````````````````````````````````````````````````
;vector
;````````````````````````````````````````````````````````````````````
resources= True
; resources@gsnMaximize = True
resources@gsnDraw = False
resources@gsnFrame = False
resources@gsnRightString = ""
resources@gsnLeftString = ""
resources@tiMainFont="Times-Roman"
resources@gsnSpreadColors = True ; use full color map
resources@vcRefLengthF = 0.1 ; ref vec length
;resources@vcGlyphStyle = "WindBarb" ; select wind barbs
resources@vcGlyphStyle = "CurlyVector" ;和上面一行是两种不同的类型,自己选
resources@vcMinDistanceF = 0.05 ; thin out windbarbs
; resources@vcRefMagnitudeF = 2
resources@vcLineArrowColor = "black"
resources@vcLineArrowHeadMaxSizeF = 0.02
resources@vcLineArrowThicknessF = 1.5
resources@tiXAxisString=""
if(i.eq.11) then
resources@vcRefAnnoOn = True
resources@vcRefAnnoOrthogonalPosF = -.26 ;vcref's position
resources@vcRefAnnoFontHeightF =0.022 ;height
else
resources@vcRefAnnoOn = False
end if
vec(i)=gsn_csm_vector(wks,u(i,:,:),v(i,:,:),resources)
overlay(temp(i),vec(i))
; delete(resources)
;``````````````````````````````````````````````````
;contour
;````````````````````````````````````````````````
cnresources=True
cnresources@gsnDraw = False
cnresources@gsnFrame = False
cnresources@gsnLeftString = ""
cnresources@gsnRightString = ""
; cnresources@gsnMaximize = True
cnresources@cnInfoLabelOn = False
cnresources@cnLineLabelsOn = False
cnresources@cnMonoLineDashPattern = True
cnresources@cnSmoothingOn = True
; cnresources@cnLevelSelectionMode="AutomaticLevels"
cnresources@cnLevelSelectionMode="ExplicitLevels"
cnresources@cnMinLevelValF=578
cnresources@cnMaxLevelValF=1128
cnresources@cnLevelSpacingF=20
;cnresources@cnLinePatterns = 1
cnresources@tiMainString =""
hgt1(i)=gsn_csm_contour(wks,hgt(i,:,:),cnresources)
; delete(cnresources)
overlay(temp(i),hgt1(i))
;draw(temp(i))
;frame(wks)
end do
presources=True
presources@gsnMaxmize = True
presources@gsnPanelLabelBar = True ;add common colorbar
; presources@gsnPanelLeft = 0.02 ; Leave room for leftmost label
presources@lbLabelFontHeightF = 0.014
presources@gsnPanelXWhiteSpacePercent = 0.0 ; remove all white space
presources@gsnPanelYWhiteSpacePercent = 0.0
presources@vcRefAnnoOn = True
gsn_panel(wks,temp,(/3,4/),presources)
draw(temp)
frame(wks)
end
|
-
|