爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7003|回复: 9

ncl 不出图啊

[复制链接]
发表于 2014-12-21 15:39:55 | 显示全部楼层 |阅读模式

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

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

x
我运行的代码
load "/usr/local/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"
begin
x = new(9,float)  ; Define two 1D arrays of 9 elements each.
y = new(9,float)
x = (/10.,20.,30.,40.,50.,60.,70.,80.,90./)
y2 = (/(/0., 0.7, 1., 0.7, 0., -0.7, -1., -0.7, 0./),\
         (/2., 2.7, 3., 2.7, 2.,  1.3,  1.,  1.3, 2./),\
         (/4., 4.7, 5., 4.7, 4.,  3.3,  3.,  3.3, 4./)/)
wks = gsn_open_wks("x11","gsun01n")  ; Open an X11 workstation.
resources=Ture
  resources@tiMainString    = "X-Y plot"  ; Title for the XY plot
  resources@tiXAxisString   = "X Axis"    ; Label for the X axis
  resources@tiYAxisString   = "Y Axis"    ; Label for the Y axis
  resources@tiMainFont      = "Helvetica" ; Font for title
  resources@tiXAxisFont     = "Helvetica" ; Font for X axis label
  resources@tiYAxisFont     = "Helvetica" ; Font for Y axis label
  resources@xyMarkLineModes = (/"Lines","Markers","MarkLines"/)
  resources@xyMarkers       = (/0,1,3/)   ; (none, dot, asterisk)
  resources@xyMarkerColor   = 3           ; Marker color
  resources@xyMarkerSizeF   = 0.03        ; Marker size (default
                                          ; is 0.01)
  plot = gsn_xy(wks,x,y2,resources)       ; Draw an XY plot.
end
运行提示错误
fatal:Variable (resources) is undefined, can not assign attribute (tiMainString)
fatal:Execute: Error occurred at or near line 12 in file 1.ncl

为什么啊,还有ncl出来的图怎么保存下来?
请大神帮忙啊
密码修改失败请联系微信:mofangbao
发表于 2014-12-21 15:46:50 | 显示全部楼层
单词拼错了 resources=True,不是Ture
密码修改失败请联系微信:mofangbao
发表于 2014-12-21 15:57:40 | 显示全部楼层
xiaocaoqiqiao 发表于 2014-12-21 15:46
单词拼错了 resources=True,不是Ture

还真是很细心呢
密码修改失败请联系微信:mofangbao
发表于 2014-12-21 15:58:40 | 显示全部楼层
Variable (resources) is undefined, can not assign attribute (tiMainString)如果出现这样的问题楼主需要去检查下和resources相关的一些语句,这种问题还是很简单的

密码修改失败请联系微信:mofangbao
发表于 2014-12-21 16:01:10 | 显示全部楼层

因为以前也犯过这种错误
密码修改失败请联系微信:mofangbao
发表于 2014-12-21 16:03:05 | 显示全部楼层
将wks = gsn_open_wks("x11","gsun01n")  
中的X11换成pdf或ps就可以生成pdf或ps文件啦
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-21 16:05:57 | 显示全部楼层
xiaocaoqiqiao 发表于 2014-12-21 15:46
单词拼错了 resources=True,不是Ture

已出图,感谢。。。。。。还是太粗心了。。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-21 16:06:16 | 显示全部楼层
又是那隻貓 发表于 2014-12-21 15:58
Variable (resources) is undefined, can not assign attribute (tiMainString)如果出现这样的问题楼主需要 ...

恩恩,谢谢啦
密码修改失败请联系微信:mofangbao
发表于 2014-12-21 19:08:02 | 显示全部楼层
喜闻乐见的错误,不过可以改一下配置文件高亮True False
密码修改失败请联系微信:mofangbao
发表于 2018-6-7 20:21:05 | 显示全部楼层
xiaocaoqiqiao 发表于 2014-12-21 15:46
单词拼错了 resources=True,不是Ture

居然犯了同样的而错误。。。。。。。 谢谢提醒 棒棒的
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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