爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5136|回复: 2

自己取的u,v(观测和模拟)对比风速,以时间为横坐标画图,用的 gsn_vector

[复制链接]
发表于 2015-9-15 14:58:39 | 显示全部楼层 |阅读模式
NCL
系统平台:
问题截图: -
问题概况: 自己取的u,v(观测和模拟)对比风速,以时间为横坐标画图,用的 gsn_vector,现在大体的图形已经有了,但是美化的时候发现很多res不能用,
我看过提问的智慧: 看过
自己思考时长(天): 5

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

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

x
本帖最后由 黄小仙儿 于 2015-9-15 15:00 编辑

自己取的u,v(观测和模拟)对比风速,以时间为横坐标画图,用的 gsn_vector,现在大体的图形已经有了,但是美化的时候发现很多res不能用,

warning:lgLabelFontHeightF is not a valid resource in gsn_vector_vector.PlotManager at this time
warning:wkPaperSize is not a valid resource in gsn_vector_vector at this time
warning:gsnLeftString is not a valid resource in gsn_vector_vector at this time


这是我的图,想把横坐标字体改小一点,竖坐标的数字和刻度隐藏了,观测和模拟的风速流线用不同的颜色,还想添加个标题。。
不知道该怎么办?从哪里可以找到相关的例子?求大家指点

画出的草图

画出的草图
密码修改失败请联系微信:mofangbao
发表于 2015-9-15 16:24:22 | 显示全部楼层
能分享一下gs不~也可以供大家具体看看也什么可以修改的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-9-15 16:45:04 | 显示全部楼层
pearal 发表于 2015-9-15 16:24
能分享一下gs不~也可以供大家具体看看也什么可以修改的

这个是ncl画的
;   Example script to produce plots for a WRF real-data run,
;   with the ARW coordinate dynamics option.

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

begin
;
; The WRF ARW input file.  
; This needs to have a ".nc" appended, so just do it.
  a = addfile("/public/home/huanglei/wrfdata/wrfout_d03_2015-05-01_12:00:00.nc","r")     

    ij = wrf_user_ll_to_ij(a, 108.58,34.26,True)

    print("lon location is: " +ij(0))

    print("lat location is: " + ij(1))
       
; First get the variables we will need
u10_2=new((/31,24/),float,"No_FillValue")
v10_2=new((/31,24/),float,"No_FillValue")


filename1=systemfunc("ls /public/home/huanglei/wrfdata/wrfout_d03_2015-05*.nc")
         fin1=addfiles(filename1,"r")
         do i=0,30
            
                 u10_1=fin1->U10(0:23,ij(1)-1, ij(0)-1)
                 v10_1=fin1->V10(0:23,ij(1)-1, ij(0)-1)
                 u10_2 (i,:)= u10_1         
                 v10_2 (i,:)= v10_1         
        end do   
                          u10=ndtooned(u10_2)
                          v10=ndtooned(v10_2)

                          u10_d=u10(0:724)
                          v10_d=v10(0:724)

;;;;;;;;;;;;;;;get obs data;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;          
  ascii_filename = "/public/home/huanglei/obs.txt"
  seismic = asciiread(ascii_filename,(/725,6/),"float")
  seismic@_FillValue = -999
     wdir = seismic(:,4)
     wspd = seismic(:,5)
     rad = 4.0*atan(1.0)/180.
     u_o = wspd*sin(rad*wdir)
     v_o = wspd*cos(rad*wdir)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
u10_new=new((/100,725/),float)
u10_new=0  
u10_new(50,:)=u10_d(0:724)
u10_new(70,:)=u_o(0:724)
v10_new=new((/100,725/),float)
v10_new=0
v10_new(50,:)=v10_d(0:724)
v10_new(70,:)=v_o(0:724)



wks  = gsn_open_wks("pdf","gsn_vector")          ; open a Graphic wkStation
  res  = True                                      ; plot mods desired
;  res@tiMainString     = "Basic Vector Plot"
  res@vcRefMagnitudeF  = 5.0                       ; add a reference vector
  res@vcRefLengthF     = 0.045                     ; what the ref length is
  res@vcGlyphStyle     = "CurlyVector"             ; turn on curley vectors
  res@gsnMaximize = True  
  res@vpHeightF   = 0.4
  res@vpWidthF   = 0.99
  res@vcRefMagnitudeF           = 0.15
  res@vcRefLengthF              = 0.001
  res@wkPaperSize = "E"
;;;;;;;; set X axis
res@tmXBMode ="Explicit"  
res@tmXBValues  =(/1,100,220,340,460,580,700/)
res@tmXBLabels = (/"5/1"," 5/5"," 5/10"," 5/15","5/20", \
                   " 5/25"," 5/30"/)
                                  
  res@gsnLeftString        ="(a)Wind"
res@pmLegendWidthF         = 0.10                  ; Change width and
res@pmLegendHeightF        = 0.10                  ; height of legend.
res@lgLabelFontHeightF     = 0.02                   ; change font height
  plot = gsn_vector(wks,u10_new,v10_new,res)

end
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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