爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 8254|回复: 6

[作图] 询问一个ncl画图设置字体时遇到的问题

[复制链接]
发表于 2013-7-20 14:11:13 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 sun_shine_Xia 于 2013-7-20 14:11 编辑

我最近在用NCL提供的例子学着画图的时候,比如说下面是example 5中的一段,例子中明明说可以用":F25:longitude"来直接定义字体的类型,而不用再写一个字体定义的语句,如下面脚本中的红色部分,但是我得到的图却是下面这个。。没搞懂是怎么一回事~~求大神们帮我看看啊,感激不尽啊!
;----------- Begin third plot -----------------------------------------

delete(resources) ; Start with a new list of resources.
resources = True
resources@tiXAxisString = ":F25:longitude"
resources@tiYAxisString = ":F25:latitude"

resources@cnFillOn = True ; Turn on contour fill.
resources@cnLineLabelsOn = False ; Turn off line labels.
resources@cnInfoLabelOn = False ; Turn off info label.
resources@pmLabelBarDisplayMode = "Always" ; Turn on a label bar.
resources@lbPerimOn = False ; Turn off label bar perim.

resources@sfXCStartV = 0 ; Define where contour plot
resources@sfXCEndV = 180 ; should lie on the map plot.
resources@sfYCStartV = 0
resources@sfYCEndV = 80

resources@mpProjection = "LambertEqualArea" ; Change the map projection.
resources@mpCenterLonF =90
resources@mpCenterLatF = 40

print(Z@nlon-1)
print(Z@nlat-1)
print(Z&lon(0))
print(Z&lat(72))

do i=0,Z@nlat-1,2
     print(Z&lat(i))
end do

resources@mpLimitMode = "LatLon" ; Limit the map view.
resources@mpMinLonF = 0
resources@mpMaxLonF = 180
resources@mpMinLatF = 0
resources@mpMaxLatF = 80
resources@mpPerimOn = True ; Turn on map perimeter.

resources@tiMainString = ":F26:January 1996 storm" ; Set a title.

resources@vpXF = 0.1 ; Change the size and location of the
resources@vpYF = 0.9 ; plot on the viewport.
resources@vpWidthF = 0.7
resources@vpHeightF = 0.7

resources@gsnScale = True ; Force X/Y axes labels to be the same size.
resources@gsnFrame = False ; Don't advance frame.

map = gsn_contour_map(wks,Z(6,5,:,:)*0.1,resources) ; Convert pf to "mb" and
; draw contours over map.
txres = True ; Set some resources
txres@txFontHeightF = 0.025 ; for a text string.
txres@txFontColor = 4
gsn_text_ndc(wks,":F25:Pressure (mb)",.45,.25,txres) ; Draw a text string on the viewport.
frame(wks) ; Advance the frame.
height (4)_页面_5.jpg
就是在标题中连:F26:也直接显示出来了,在官网上也没找到怎么解决~
密码修改失败请联系微信:mofangbao
发表于 2013-7-20 14:34:31 | 显示全部楼层
本帖最后由 尽头的尽头 于 2013-7-20 14:42 编辑

无标题.jpg NCL在6.1.0版本以后,NCL将function code 由”:”变成“~”,所以你需要把脚本中的“:”用“~”替换就可以了,结果如图
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-7-20 15:25:13 | 显示全部楼层

原来如此。。。谢谢尽头了哈~~祝福你没有尽头~~
密码修改失败请联系微信:mofangbao
发表于 2013-7-20 15:32:03 | 显示全部楼层
sun_shine_Xia 发表于 2013-7-20 15:25
原来如此。。。谢谢尽头了哈~~祝福你没有尽头~~

不客气~谢谢你的祝福,多多支持家园~~
密码修改失败请联系微信:mofangbao
发表于 2017-7-7 15:29:39 | 显示全部楼层
想问问如何改变坐标的字体呢
密码修改失败请联系微信:mofangbao
发表于 2017-9-27 11:09:04 | 显示全部楼层
lucinda筱橙 发表于 2017-7-7 15:29
想问问如何改变坐标的字体呢

同问,如何改变坐标的字体?
密码修改失败请联系微信:mofangbao
发表于 2023-8-16 17:46:00 | 显示全部楼层
学到了
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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