爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4626|回复: 1

[作图] 求大神帮助!

[复制链接]
发表于 2016-7-20 17:34:25 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
1.设置经纬度怎么没效果?
2.怎么感觉我这向量图和官网的差好多啊?
代码如下:
; load "$NCARG_ROOT[img]file:///C:/Users/jx/AppData/Local/Temp/)A[Y)I~](ZC9Z[3Y)IDK7LK.gif[/img]b/ncarg/nclscripts/csm/gsn_code.ncl"
;load "$NCARG_ROOT[img]file:///C:/Users/jx/AppData/Local/Temp/)A[Y)I~](ZC9Z[3Y)IDK7LK.gif[/img]b/ncarg/nclscripts/csm/gsn_csm.ncl"
; load "$NCARG_ROOT[img]file:///C:/Users/jx/AppData/Local/Temp/)A[Y)I~](ZC9Z[3Y)IDK7LK.gif[/img]b/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT[img]file:///C:/Users/jx/AppData/Local/Temp/)A[Y)I~](ZC9Z[3Y)IDK7LK.gif[/img]b/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT[img]file:///C:/Users/jx/AppData/Local/Temp/)A[Y)I~](ZC9Z[3Y)IDK7LK.gif[/img]b/ncarg/nclscripts/cnmap/cnmap.ncl"

begin

  a = addfile("$NCARG_ROOT[img]file:///C:/Users/jx/AppData/Local/Temp/)A[Y)I~](ZC9Z[3Y)IDK7LK.gif[/img]b/ncarg/nclscripts/uv-wind/uv_wind.nc","r")
  u = short2flt(a->u(0,:,:))                           
  v = short2flt(a->v(0,:,:))

  wks = gsn_open_wks("png","vector")               ; send graphics to PNG file
  gsn_define_colormap( wks ,"rainbow")
  
;>--------------------------------------------<
;            set for the map
;>--------------------------------------------<
res                                 = True
res@mpMinLatF               = 15.                        
res@mpMaxLatF               = 55.
res@mpMinLonF               = 72.
res@mpMaxLonF               = 136.

res@mpFillOn                      = True
res@mpOutlineOn                = False  ; Use outlines from shapefile
res@cnFillDrawOrder            = "PreDraw"
res@mpDataBaseVersion       = "MediumRes"
res@mpDataSetName           = "Earth..4"
res@mpAreaMaskingOn         = True
res@mpMaskAreaSpecifiers    = (/"China","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
res@mpLandFillColor             = "white"
res@mpInlandWaterFillColor  = "white"
res@mpOceanFillColor           = "white"
res@mpOutlineBoundarySets  = "NoBoundaries"
;>--------------------------------------------<
  vcres                         =True
  vcres@gsnFrame                = False            ; so we can draw time stamp
  vcres@vcRefAnnoOrthogonalPosF = -1.0             ; move ref vector up
  vcres@vcRefMagnitudeF         = 10.0             ; define vector ref mag
  vcres@vcRefLengthF            = 0.045            ; define length of vec ref
  vcres@vcRefAnnoArrowLineColor ="red"             ; jian tou yan se
  vcres@vcRefAnnoArrowUseVecColor = False

  vcres@vcGlyphStyle            = "CurlyVector"    ; turn on curly vectors
  vcres@vcLineArrowColor        ="white"
  vcres@vcLineArrowThicknessF   =1.25
  vcres@vcVectorDrawOrder       ="PostDraw"
  vcres@vcMinDistanceF          = 0.01
  vcres@vcMonoLineArrowColor    =False

  vector = gsn_csm_vector_map(wks,u,v,vcres)
;>============================================================<
;                      add China map
;>------------------------------------------------------------<
cnres           = True
cnres@china     = True       ;draw china map or not
cnres@river     = True       ;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,vector,cnres)
;>============================================================<

  draw(vector)
  frame (wks)  
end

我的

我的

官网的

官网的

uv_wind.nc

455.99 KB, 下载次数: 0, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-7-21 10:27:44 | 显示全部楼层
res@mpMinLatF               = 15.                        
res@mpMaxLatF               = 55.
res@mpMinLonF               = 72.
res@mpMaxLonF               = 136.
改成:                                            
vcres@mpMinLatF               = 15.                        
vcres@mpMaxLatF               = 55.
vcres@mpMinLonF               = 72.
vcres@mpMaxLonF               = 136.
就行。
vector.png
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表