- 积分
- 1095
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-3
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 SG哭晕在厕所 于 2016-11-20 21:50 编辑
从官网上扒了一个例子自己试了试,但是一直显示fatal:(lat) is not a named dimension in variable (t).试着改了很多东西都没什么效果,被维度这个问题困扰挺久了,跪求大神帮忙解答
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;---Read in data
f = addfile("wrfout_d01_2016-10-03_11:00:00","r")
t = f->T2(0,:,:) ; get t data
;---To plot multiple lines, you must put them into a mulidimensional array.
data = new((/2,dimsizes(t&lat)/),float)
data(0,:) = u(0,:,{50})
data(1,:) = u(0,:,{51})
wks = gsn_open_wks ("png","xy") ; send graphics to PNG file
;---Set plotting parameters
res = True ; plot mods desired
res@tiMainString = "Two curve XY plot" ; add title
;
; Similiar resources are xyLineThicknessF and xyLineColor,
; which will affect all lines in the array.
;
res@xyLineThicknesses = (/ 1.0, 2.0/) ; make second line thicker
res@xyLineColors = (/"blue","red"/) ; change line color
plot = gsn_csm_xy (wks,t&lat,data,res) ; create plot
end |
|