爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6072|回复: 4

标注求助

[复制链接]
发表于 2014-4-5 16:29:06 | 显示全部楼层 |阅读模式

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

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

x
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
files = "./wrfout_d02_2001-04-07_00:00:00.nc"
f=addfile(files,"r")
loc = wrf_user_latlon_to_ij(f,31.24,121.0)
print(loc)
i = loc(0)
j = loc(1)
tt=chartostring(f->Times)           ;时间给了tt
tn=dimsizes(tt)   
lat1d = f->XLAT(0,:,:)
lon1d = f->XLONG(0,:,:)
lc = f->SWDNB(:,:,:)               ; o3
xwks = gsn_open_wks("pdf","lc")   ; pdf工作站
gsn_define_colormap(xwks,"BlAqGrYeOrReVi200") ; select color map
;颜色
res=True
;************************************************
  res@gsnAddCyclic  = False     
  res@mpDataSetName         = "Earth..4"   ; This new database contains
                                           ; divisions for other countries.
  res@mpDataBaseVersion     = "MediumRes"  ; Medium resolution database
res@mpOutlineOn=True ; Turn on map outlines
  res@mpOutlineSpecifiers=(/"China","Xinjiang Uygur"/) ;China:states
;***********************************************
res@gsnSpreadColors       = True             ; use full range of colormap
res@cnFillOn              = True             ; color plot desired
  res@cnLinesOn             = False            ; turn off contour lines
  res@cnLineLabelsOn        = False            ; turn off contour labels
  res@gsnRightString        = "W m-2"   

WRF_map_c(f, res, 0)                   ; reads info from file
;************************************************
; if appropriate, set True for native mapping (faster)
; set False otherwise
;************************************************
  res@tfDoNDCOverlay       = True     

;************************************************
; associate the 2-dimensional coordinates to the variable for plotting
; only if non-native plot
;************************************************
  if (.not.res@tfDoNDCOverlay) then
      x@lat2d = f->XLAT(0,:,:)                     ; direct assignment
      x@lon2d = f->XLONG(0,:,:)
  end if

;************************************************
; Turn on lat / lon labeling
;************************************************
res@pmTickMarkDisplayMode = "Always"         ; turn on tickmarks
res@tmXTOn = False            ; turn off top   labels
;res@tmYROn = False            ; turn off right labels
;************************************************



nt = 1
  do nt=1,tn-1            
res@tiMainString     = tt(nt)
plot = gsn_csm_contour_map(xwks,lc(nt,:,:),res)       ; Draw a contour plot.
end do
delete(plot)
end QQ截图20140405162445.png 画出来的图上的单位被挡住,而且变量名称显示不全


密码修改失败请联系微信:mofangbao
发表于 2014-4-5 19:38:33 | 显示全部楼层
要么把变量的long_name或者gsnLeftString设置短点,要么就设置下字体大小吧!
相关属性如下:
gsnLeftString
gsnLeftStringFontHeightF

另外,你设置了res@pmTickMarkDisplayMode = "Always",为什么坐标都没有显示?
密码修改失败请联系微信:mofangbao
发表于 2014-6-12 11:51:12 | 显示全部楼层
楼主 可不可以问你一下为什么我的wrfout中没有SWDNB变量呢?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-6-12 20:23:22 | 显示全部楼层
sicuoren 发表于 2014-6-12 11:51
楼主 可不可以问你一下为什么我的wrfout中没有SWDNB变量呢?

这应该是和你选的辐射方案有关系吧
密码修改失败请联系微信:mofangbao
发表于 2014-6-16 01:21:02 | 显示全部楼层
设置gsnMaximizes 另外可以根据字符串大小设置换行
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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