爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 8952|回复: 5

[作图] 【求助】ncl作图 如何变的更清晰

[复制链接]
发表于 2012-11-23 10:18:54 | 显示全部楼层 |阅读模式

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

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

x
未命名.jpg
大家帮我看看这幅图,做出来的图太密了,我想做的好看一点,想了想如果想不这么密得改变变量T显示的密度,但是具体怎么操作我不太懂,大家可以帮我看看么?万分感谢!
我的脚本如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
        
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
  a = addfile("./wrfout_d02_2012-01-01_00:00:00.nc","r")
        
        
; We generate plots, but what kind do we prefer?
; type = "x11"
  type = "pdf"
; type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"plt_CrossSection_2-test")
        
        
; Set some basic resources
  res = True
  res@MainTitle = "REAL-TIME WRF"
        
  res@cnLevelSelectionMode      ="ManualLevels"
  res@lbLabelStride             = 1
  res@cnMinLevelValF            = 10
  res@cnMaxLevelValF            = 35
  res@cnLevelSpacingF           = 0.5
  res@Footer = False
        
  pltres = True
        
        
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        
  times  = wrf_user_list_times(a)   ; get times in the file
  ntimes = dimsizes(times)          ; number of times in the file
  FirstTime = True
        
  mdims = getfilevardimsizes(a,"P") ; get some dimension sizes for the file
  nd = dimsizes(mdims)
        
;--------------------------------------------------------------- do it = 0,ntimes-1,2                  ; TIME LOOP
        
    print("Working on time: " + times(it) )
    res@TimeLabel = times(it)           ; Set Valid time to use on plots
        
    tc  = wrf_user_getvar(a,"tc",it)     ; T in C
        
    z   = wrf_user_getvar(a, "z",it)     ; grid point height
        
    if ( FirstTime ) then                ; get height info for labels
      zmin = 0.
    ;  zmax=max(z)/1000
      zmax = 4.
      nz   = floattoint(zmax/2+1)
      FirstTime = False
    end if
    T!0="lat"
    T!1="lon"
    T&lat=(/-90.,-85.,...,85.,90./)
    T&lon=fspan(0.,355.,72); Plot a cross session that run south-north through the middle of the plot
; For this we need a pivot point and a angle
        
;                   |
;       angle=0 is  |
;                   |
;
        
        angle = 0
        plane = new(2,float)
        plane = (/ mdims(nd-1)/2, mdims(nd-2)/2 /)    ; pivot point is center of domain (x,y)
        opts = False                                  ; start and end points not specified
        
        tc_plane = wrf_user_intrp3d(tc,z,"v",plane,angle,opts)
        
        
        dim = dimsizes(tc_plane)                      ; Find the data span - for use in labels
        zspan = dim(0)
        
      ; Options for XY Plots
        opts_xy                         = res
        opts_xy@tiYAxisString           = "Height (km)"
        opts_xy@cnMissingValPerimOn     = True
        opts_xy@cnMissingValFillColor   = 0
        opts_xy@cnMissingValFillPattern = 11
        opts_xy@tmYLMode                = "Explicit"
        opts_xy@tmYLValues              = fspan(0,zspan,nz)                    ; Create tick marks
        opts_xy@tmYLLabels              = sprintf("%.1f",fspan(zmin,zmax,nz))  ; Create labels
        opts_xy@tiXAxisFontHeightF      = 0.020
        opts_xy@tiYAxisFontHeightF      = 0.020
        opts_xy@tmXBMajorLengthF        = 0.02
        opts_xy@tmYLMajorLengthF        = 0.02
        opts_xy@tmYLLabelFontHeightF    = 0.015
        opts_xy@PlotOrientation         = tc_plane@Orientation
        
        
      ; Plotting options for T
        opts_tc = opts_xy
        ;opts_tc@ContourParameters       = (/ 10., 30., 2. /)
        opts_tc@ContourParameters  = (/ 5. /)
        opts_tc@cnInfoLabelOrthogonalPosF = 0.00
        opts_tc@pmLabelBarOrthogonalPosF = -0.07
        opts_tc@cnFillOn                = True
        opts_tc@cnFillColors            = (/"White","White","White", \
                                            "White","Chartreuse","Green", \
                                            "Green3","Green4", \
                                            "ForestGreen","PaleGreen4"/); Get the contour info for the rh and temp
        contour_tc = wrf_contour(a,wks,tc_plane,opts_tc)
        
        
        
      ; MAKE PLOTS
        plot = wrf_overlays(a,wks,(/contour_tc/),pltres)
        
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        
  end do        ; END OF TIME LOOP
        
end


密码修改失败请联系微信:mofangbao
发表于 2012-11-23 10:52:55 | 显示全部楼层
好乱了,看不清
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2012-11-23 10:54:53 | 显示全部楼层

嗯,做出来的图太乱了,我换别的wrfout的结果就很清晰,还是和这个结果有关,显示数据这里我应该改哪里呢??
密码修改失败请联系微信:mofangbao
发表于 2012-12-26 02:19:11 | 显示全部楼层
做出来的图太乱了
密码修改失败请联系微信:mofangbao
发表于 2014-3-25 14:25:53 | 显示全部楼层
有没有带注释的
密码修改失败请联系微信:mofangbao
发表于 2014-3-25 15:21:45 | 显示全部楼层
本帖最后由 longlivehj 于 2014-3-25 15:25 编辑

你这个就是wrf官网上的示例代码
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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