爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 896|回复: 1

[作图] 折线图上添加文本失败

[复制链接]

新浪微博达人勋

发表于 2023-7-19 13:52:54 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 推开世界的门 于 2023-7-19 14:04 编辑

各位老师:
      我想在折线图上添加一个文本,按照以下代码程序没有报错,但是图中也不显示,请问一下各位老师是什么原因,
res1                  = True                     ; plot mods desired
res1@trYReverse       =True



res1@vpHeightF=0.6        ;图表高度
res1@vpWidthF=0.3         ;图表宽度

res1@gsnMaximize      = True
res1@gsnBoxMargin     = 0.0

res1@tiMainFontHeightF= 0.02
res1@tiMainString     = ""          ; add title+
res1@trXMinF          = 0
res1@trXMaxF          = 11
res1@xyLineThicknesses=5
res1@xyLineColors="red"

res1@tmYLMode="Explicit"
res1@tmYLValues=(/700,750,800,850,900,950,1000/)
res1@tmYLLabels=(/"3000","2500","2000","1500","1000","500","0"/)

res1@tiXAxisString="Wind speed(m/s)"
res1@tiYAxisString="Height(m)"

res2               = True
res2@trYReverse       =True
res2@xyLineThicknesses=5
res2@xyLineColors="blue"

res3               = True
res3@trYReverse       =True
res3@xyLineThicknesses=5
res3@xyLineColors="black"

res4               = True
res4@trYReverse       =True
res4@xyLineThicknesses=5
res4@xyLineColors="green"


plot1  = gsn_csm_xy (wks,s070100,y,res1) ; create plot
plot2  = gsn_csm_xy (wks,s070106,y,res2) ; create plot
plot3  = gsn_csm_xy (wks,s070112,y,res3) ; create plot
plot4  = gsn_csm_xy (wks,s070118,y,res4) ; create plot

overlay(plot1,plot2);覆盖
overlay(plot1,plot3)
overlay(plot1,plot4)

txres1               = True                           
txres1@txFontHeightF = 10             ; Set the font height

text1=gsn_add_text(wks,plot1,"a",0,0,txres1)

;overlay(plot1,text1)

draw(plot1);绘制
frame(wks);翻页

图1

图1
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2024-3-24 14:50:14 | 显示全部楼层
请问你解决了吗,我也遇到这个问题,崩溃
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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