爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 11416|回复: 14

[作图] NCL 求助不能调节字体大小了 问题出在哪里啊

[复制链接]
发表于 2015-6-5 11:36:25 | 显示全部楼层 |阅读模式

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

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

x
为什么NCL画出来的图向调节x轴y轴的字体大小,调不了呢
res = True
  res@NoHeaderFooter           = True            ; Switch headers and footers off
  res@tmXBLabelFontHeightF = 0.02
  res@tmYLLabelFontHeightF = 0.02
  res@vpWidthF         = 0.4                      ; set width and height
  res@vpHeightF        = 0.3
  res@vpXF = 0.1
  res@vpYF = 0.9
  res@cnFillOn = True
  pltres = True
  mpres = True

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      sd1 = wrf_user_getvar(a,"SWDOWN",23)
        contour = wrf_contour(a,wks,sd1,res)
;        pltres@PlotTitle =  "CTL"
        plots = wrf_map_overlays(a,wks,contour,pltres,mpres)

密码修改失败请联系微信:mofangbao
发表于 2015-6-5 23:05:32 | 显示全部楼层
在 plots = wrf_map_overlays(a,wks,contour,pltres,mpres) 这一行之前,
设置mpres试试,
  mpres@tmXBLabelFontHeightF = 0.02
  mpres@tmYLLabelFontHeightF = 0.02

如果成功解决,你可以自己看看 $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl 这个脚本,查找tmXBLabelFontHeightF 关键字。
密码修改失败请联系微信:mofangbao
回复 支持 2 反对 0

使用道具 举报

发表于 2015-6-5 11:55:11 | 显示全部楼层
好像也不懂
密码修改失败请联系微信:mofangbao
回复 支持 0 反对 1

使用道具 举报

发表于 2015-6-5 13:52:47 | 显示全部楼层
确定画图顺序没错?改这个res@tmYLLabelFontHeightF = 0.02没有用?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-6-5 15:52:12 | 显示全部楼层
talkd 发表于 2015-6-5 13:52
确定画图顺序没错?改这个res@tmYLLabelFontHeightF = 0.02没有用?

我把程序就删减到很短了 除了前面的话就剩这些了  改了这个0.02到0.08 、0.1都没有用
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-6-5 15:53:53 | 显示全部楼层
talkd 发表于 2015-6-5 13:52
确定画图顺序没错?改这个res@tmYLLabelFontHeightF = 0.02没有用?

求大神解释啊 为什么啊 我把整个程序都贴出来吧
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
a = addfile("/gpfshome/zhanglei1/yuanguanghui/laode/wrf3.5/WRFV3/run/laodejieguo/0912meigai/wrfout_d03_2008-09-11_00:00:00.nc","r")
;b = addfile("/gpfshome/zhanglei1/yuanguanghui/laode/wrf3.5/WRFV3/run/laodejieguo/0912+25%/wrfout_d03_2008-09-11_00:00:00.nc","r")
;c = addfile("/gpfshome/zhanglei1/yuanguanghui/laode/wrf3.5/WRFV3/run/laodejieguo/0912+50%/wrfout_d03_2008-09-11_00:00:00.nc","r")
;d = addfile("/gpfshome/zhanglei1/yuanguanghui/laode/wrf3.5/WRFV3/run/laodejieguo/0912-25%/wrfout_d03_2008-09-11_00:00:00.nc","r")
;e = addfile("/gpfshome/zhanglei1/yuanguanghui/laode/wrf3.5/WRFV3/run/laodejieguo/0912-50%/wrfout_d03_2008-09-11_00:00:00.nc","r")



; We generate plots, but what kind do we prefer?
;  type = "x11"
  type = "png"
; type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"shortdownwave")
  gsn_define_colormap(wks,"rainbow")  ; overwrite the .hluresfile color map


; Set some basic resources
  res = True
  res@NoHeaderFooter           = True            ; Switch headers and footers off
  res@tmXBLabelFontHeightF = 0.02
  res@tmYLLabelFontHeightF = 0.02
  res@vpWidthF         = 0.4                      ; set width and height
  res@vpHeightF        = 0.3
  res@vpXF = 0.1
  res@vpYF = 0.9
res@cnFillOn = True
  pltres = True
  mpres = True


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


      sd1 = wrf_user_getvar(a,"SWDOWN",23)
        contour = wrf_contour(a,wks,sd1,res)
;        pltres@PlotTitle =  "CTL"
        plots = wrf_map_overlays(a,wks,contour,pltres,mpres)
        delete(contour)
;************************************************************

end
                                             
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-6-6 09:35:54 | 显示全部楼层
hzwjy 发表于 2015-6-5 23:05
在 plots = wrf_map_overlays(a,wks,contour,pltres,mpres) 这一行之前,
设置mpres试试,
  mpres@tmXBL ...

是的  这样就可以调了  感谢啊
密码修改失败请联系微信:mofangbao
发表于 2015-6-6 09:38:17 | 显示全部楼层
wrf 自带的 ncl 画图程序有点复杂,既然对 contour 的 res 设置无效,不妨试试对 pltres 与 mpres 进行设置。
密码修改失败请联系微信:mofangbao
发表于 2015-6-6 09:49:20 | 显示全部楼层
837078493 发表于 2015-6-5 15:53
求大神解释啊 为什么啊 我把整个程序都贴出来吧
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code. ...

应该设置mpres@tmXBLabelFontHeightF
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-6-6 15:20:52 | 显示全部楼层
夏朗的芒果 发表于 2015-6-6 09:38
wrf 自带的 ncl 画图程序有点复杂,既然对 contour 的 res 设置无效,不妨试试对 pltres 与 mpres 进行设置 ...

恩恩 是的 是对mpres设置就管用了
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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