爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 8422|回复: 0

[作图] gsn_add_annotation添加的图例不显示--已解决

[复制链接]
回帖奖励 30 金钱 回复本帖可获得 3 金钱奖励! 每人限 4 次

新浪微博达人勋

发表于 2017-12-16 17:01:56 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 男紫汗 于 2017-12-17 17:37 编辑

出图正常,只是添加的图例不显示,部分代码如下,请指点(前面漏了  res@gsnDraw = False
res@gsnFrame =False
)
plot = gsn_csm_xy(wks,xtime(13:ntimes-13),c(:,13:36),res)          ; Draw an XY plot with 1 curve.
lgres1=True
lgres1@lgLineColors=(/"red","green","blue","orange","brown","purple","red"/)
lgres1@lgMonoLineThickness=True
lgres1@lgLineThicknessF=2.5
lgres1@lgItemType="Lines"
lgres1@lgLabelFontHeightF=0.08
lgres1@lgPerimOn=False
;lgres1@lgLineLabelFontHeightF=0.05
lgres1@vpWidthF=0.08
lgres1@vpHeightF     = 0.08
lgres1@lgDashIndexes=(/0,0,0,0,0,0,1/)
lg1=(/"P~B~IACR~","P~B~SACR~","-P~B~REVP~","-P~B~RAUT~","-P~B~RACW~","P~B~GFRG~","P~B~GACR*~F33~d~F21~4"/)
leg1=gsn_create_legend(wks, 7, lg1, lgres1)

amres1=True
amres1@amJust="TopLeft"
;amres1@amParallelPosF=-0.5
;amres1@amOrthogonalPosF=0.52
aaa1=gsn_add_annotation(plot, leg1, amres1)

lgres2=True
lgres2@lgLineColors=(/"green","blue","orange","brown","purple","black","black"/)
lgres2@lgMonoLineThickness=True
lgres2@lgLineThicknessF=2.5
lgres2@lgItemType="Lines"
lgres2@lgLabelFontHeightF=0.08
lgres2@lgPerimOn=False
;lgres1@lgLineLabelFontHeightF=0.05
lgres2@vpWidthF=0.08
lgres2@vpHeightF     = 0.08
lgres2@lgDashIndexes=(/1,1,1,1,1,0,1/)
lg2=(/"P~B~GACRP*(1-~F33~d~F21~4)","-P~B~SACW~","P~B~SMLT~","P~B~GMLT~","-P~B~GACW~","Rain","Q~B~cmr~"/)
leg2=gsn_create_legend(wks, 7, lg2, lgres2)
amres2=True
amres2@amJust="TopRight"
;amres2@amParallelPosF=-0.5
;amres2@amOrthogonalPosF=0.52
aaa2=gsn_add_annotation(plot, leg2, amres2)
draw(plot)
frame(wks)
end

密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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