爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4599|回复: 2

ncl作图的label遮到图了这怎么调

[复制链接]

新浪微博达人勋

发表于 2017-7-18 09:15:39 | 显示全部楼层 |阅读模式

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

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

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/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

  indir1 = "/public/home/changshucheng/emission/htap_emis/res/test/"
  indir2 = "/public/home/changshucheng/program/daniel/htap_maps/src/latlon/"

;----------------------------------------------------------------------
;model
;----------------------------------------------------------------------
  char_len =(/4,2,2/)
  infile1 = "res_1"
  infile2 = "latlon.nc"

  a = addfile(indir1+infile1+".nc","r")
  b = addfile(indir2+infile2+".nc","r")

  lat2d=b->LAT(0,0,:,:)
  lon2d=b->LON(0,0,:,:)

  dimll = dimsizes(lat2d)
  nlat  = dimll(0)
  nlon  = dimll(1)

  model_data = wrf_user_getvar(a,"BC",0)  ;;;;;;;;;;;;;;;;;;;;;
;  model_data=model_data*1000000000000
  val=model_data(0,:,:)
  val!0= "lat"
  val!1= "lon"
  val@lat2d=lat2d
  val@lon2d=lon2d

;----------------------------------------------------------------------
;plot
;----------------------------------------------------------------------
  outfile = "NOx_10"      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  wks = gsn_open_wks("png",outfile)
  gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")

  colors = ispan(12,201,9)

;--------------------------------------------------------------
  res = True
  res@gsnDraw                = False
  res@gsnFrame               = False
  res@gsnMaximize            = True
  res@gsnAddCyclic           = False
  res@gsnPaperOrientation    = "portrait"
;--------------------------------------------------------------
  res@pmTickMarkDisplayMode  = "Always"
  res@mpLimitMode="LatLon"
  res@mpCenterLonF=180
  res@mpMinLonF=0
  res@mpMaxLonF=360
  res@mpMinLatF=-90
  res@mpMaxLatF=90
  res@mpPerimOn=True

  res@mpFillOn               = True
  res@mpDataSetName          = "Earth..4"
  res@mpDataBaseVersion      = "MediumRes"   ;Low
  res@mpLandFillColor        = "Background"
;  res@mpOutlineBoundarySets  = "NoBoundaries"
;  res@mpOutlineBoundarySets  = "AllBoundaries" ; state boundaries "National"  ;
  res@mpOutlineBoundarySets  = "National"
  res@mpOutlineOn            = True
;  res@mpOutlineBoundarySets  = "China:states"
;  res@mpOutlineSpecifiers    = (/"China:states","Taiwan"/)
  res@mpGridAndLimbOn        = False               ; turn on lat/lon grid lines
  res@mpGridLineDashPattern  = 2
  res@tmYROn          = False
  res@tmXTOn          = False
;----------------------------------------------------------------------
; plot for Model Data
  res@cnFillOn                = True
  res@cnLinesOn               = False
  res@cnLineLabelsOn          = False
  res@cnInfoLabelOn           = False
  res@cnConstFLabelOn         = False
  res@cnLevelSelectionMode    = "ManualLevels"
  res@cnLevelSpacingF         = 1         ;;;;;;;;;;;;;;;;;;
  res@cnMinLevelValF          = 1      ;;;;;;;;;;;;;;;;
  res@cnMaxLevelValF          = 20   ;;;;;;;;;;;;;;
  res@cnFillColors            = colors
  res@gsnSpreadColors         = True

; plot for label
  res@pmLabelBarDisplayMode   = "Always"
  res@pmLabelBarWidthF        = 0.7
  res@pmLabelBarHeightF       = 0.05
  res@lbAutoManage            = False
;  res@lbOrientation           = "Vertical"
  res@lbOrientation           = "horizontal"
  res@lbPerimOn               = False
  res@lbLabelStride           = 1
  res@lbLabelFontHeightF      = 0.01
  res@lbTitleOn               = False
  res@lbLabelPosition         = "Bottom"

;  res@gsnLeftString           = "NMVOC~B~S~N~ (10~S~6~N~ mole/yr)"
  res@gsnLeftString           = "NO~B~X~N~ (10E-12 kg s-2 m-1)"  ;;;;;;;;;;;;;;;;;;;;;;
;  res@gsnLeftString           = "BC (ton/yr)"
;  res@gsnRightString          = "ave (2013-2016)"
  res@gsnRightStringFontHeightF = 0.

  plot= gsn_csm_contour_map(wks,val,res)
;----------------------------------------------------------------------

  draw(plot)
  frame(wks)
;-------------------------------------------------------------------------------------

end


test.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-7-18 11:54:56 | 显示全部楼层
pmLabelBarOrthogonalPosF
pmLabelBarParallelPosF

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-7-19 10:36:28 | 显示全部楼层
多谢,已解决
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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