- 积分
- 10655
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-10
- 最后登录
- 1970-1-1
|
发表于 2014-3-18 11:04:23
|
显示全部楼层
本帖最后由 longlivehj 于 2014-3-18 11:54 编辑
贝頥嚫 发表于 2014-3-18 10:05
我就是看的这个,鼓捣了半天,失败了。
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/contrib/cd_string.ncl"
begin
units = "hours since 1-1-1 00:00:0.0"
xbrange = tointeger(cd_inv_calendar((/1, 1/), (/1, 1/), (/12, 15/), (/12, 16/), (/0, 0/), (/0, 0/), units, 0))
xbvalues = ispan(xbrange(0), xbrange(1), 6)
xbvalues := array_append_record(xbvalues, xbrange(1), 0)
xbvalues@units = units
xblabels = cd_string(xbvalues, "%d.%H")
npts = dimsizes(xbvalues)
random = new(npts, integer)
do i = 0, npts - 1
random(i) = rand()
end do
res = True
res@tmXBMode = "Explicit"
res@tmXBValues = xbvalues
res@tmXBLabels = xblabels
res@tmXBLabelFontHeightF = .01
res@tmYLLabelFontHeightF = .01
res@trXMinF = xbvalues(0)
res@trXMaxF = xbvalues(npts - 1)
wks = gsn_open_wks ("x11", "time_axis")
plot = gsn_csm_xy(wks, xbvalues, random, res)
end |
|