爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5520|回复: 1

[作图] 求助:ncl画出的图没有刻度!

[复制链接]
发表于 2016-2-21 21:27:03 | 显示全部楼层 |阅读模式

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

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

x
ncl画出的图没有刻度,不知道哪里错了,请大神指点

;================================================;
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"
; ================================================;
  begin
;=================================================;
; open file and read in data
;=================================================;
  fils1=systemfunc("ls /gpfssan1/home/outA_20100114.nc")
  f1=addfile(fils1,"r")

  region=f1->land
  printVarSummary(region)
;===================================================;
;===================================================;
;===================================================;
;===================================================;
;================================================T
  region!0="time"
  region!1="lev"
  region!2="x"
  region!3="y"
  region@long_name="landcover type"
  region@units=" "
;=================================================;
; plot
;=================================================;
level=1
pngoutpath="region"
system("mkdir -p "+pngoutpath)
outname:="region/region_suzhou"
  res                             =True
;------Tperature filled contour plot------------
  wks=gsn_open_wks("png",outname)
  gsn_define_colormap(wks,"seaice_2")
  tf_res                          = res          ; plot mods desired
  tf_res@cnFillOn                 = True          ; turn on color
;  tf_res@cnFillMode            = "RasterFill"    ; Smooth raster contours
;  tf_res@cnRasterSmoothingOn   = True
  tf_res@cnLinesOn                = False
  tf_res@cnLineLabelsOn           = False
; tf_res@cnLevelSelectionMode="ExplicitLevels"
; tf_res@cnLevels                 =(/-0.7,-0.65,-0.6,-0.55,-0.5,-0.45,-0.4/)
  tf_res@cnLevelSelectionMode     ="ManualLevels"
  tf_res@cnMinLevelValF           =1
  tf_res@cnMaxLevelValF           =5
  tf_res@cnLevelSpacingF         =1
  tf_res@gsnMaximize              = True
  tf_res@gsnBoxMargin             = 0.0
  tf_res@gsnStringFont            ="times-bold"
  tf_res@gsnStringFontHeightF     =0.025
  tf_res@gsnSpreadColors          = True          ; use full range of colormap
;  tf_res@gsnSpreadColorStart     = 2+30
;  tf_res@gsnSpreadColorEnd       = 52-102-2
;   tf_res@gsnSpreadColorEnd       = 102

  tf_res@tmXBLabelFont            = "times-bold"
  tf_res@tmXBLabelFontHeightF    = 0.025
  tf_res@tmYLLabelFont            = "times-bold"
  tf_res@tmYLLabelFontHeightF    = 0.025
  tf_res@lbLabelFont             = "times-bold"
  tf_res@lbLabelFontHeightF      = 0.02
  tf_res@lbPerimOn               =False
  tf_res@lbOrientation           = "Vertical"
  ;tf_res@lbLabelStride           = 4
  tf_res@lbBoxLinesOn            =False
  tf_res@lbLabelPosition         = "right"

  tf_res@tiXAxisString           ="X (km)"
  tf_res@tiXAxisFont             = "times-bold"
  tf_res@tiYAxisString           ="Y (km)"
  tf_res@tiYAxisFont             = "times-bold"
  tf_res@gsnDraw                 = False
  tf_res@gsnFrame                = False
;  tf_res@gsnAddCyclic            = False        
  tf_res@pmTickMarkDisplayMode   = "Always"   
   tf_res@cnFillDrawOrder = "PreDraw"


  tf_plot = gsn_csm_contour(wks,region(1,0,:,:),tf_res)       ; contour the variable

;-------wind vector plot----------------------------
  vec_res                       = res
  vec_res@gsnLeftString         =""
  vec_res@gsnRightString        =""   
  vec_res@gsnDraw                 = False
  vec_res@gsnFrame                = False                       

;------------------overlay
  draw(tf_plot)
  frame(wks)

end


密码修改失败请联系微信:mofangbao
发表于 2016-2-22 11:27:44 | 显示全部楼层
同问,也顶一下
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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