爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7135|回复: 0

[作图] NCL参考线绘制

[复制链接]
发表于 2019-7-27 14:06:40 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 何源 于 2019-7-27 16:13 编辑

请问,有朋友遇见过,NCL折线图中,在画参考线之后,出现参考线遮蔽部分线段的问题嘛?是如何解决的呢?谢谢作图代码如下:
;---------------------Draw the plot----------------
res=True
res@gsnDraw=False
res@gsnFrame=False
res@vpHeightF=0.3
res@vpWidthF=0.7
res@trXMaxF=2011
res@trXMinF=1965
res@tiXAxisString="Year"
res@tiYAxisFontHeightF=0.018
res@tiXAxisFontHeightF=0.018
res@gsnYRefLine=0
res@gsnYRefLineThicknessF=1.5
res@tmYROn=False
res@tmXTOn=False
res@tmXBMode="Manual"
res@tmXBLabels=year
res@xyLineColor="red"
res@xyLineThicknessF=2.0
res@xyMarkLineMode="MarkLines"
res@xyMarker=1
res@xyMarkerSizeF=0.025
res@gsnYRefLine=0
res@gsnYRefLineThicknesse=1.5
res@xyMarkerColor="black"

wks=gsn_open_wks("eps", get_script_prefix_name())
plot=new(2,graphic)

do i=0,1
    if(i.eq.0)then
        data=ipr
        res1=res
        res1@tiYAxisString="Precipitation anomaly/mm"
        res1@xyLineColor="blue"
        res1@xyMarkerColor="blue"
        plot(i)=gsn_csm_xy(wks,year,data,res1)
    end if
    if(i.eq.1)then
        data=itm
        res2=res
        res2@xyMarkerColor="red"
        res2@tiYAxisString="Temperature anomaly/~S~o~N~C"  
         plot(i)=gsn_csm_xy(wks,year,data,res2)
    end if
    delete(data)
end do

resP                    = True                 ; modify the panel plot
  resP@gsnFrame           = False                ; don't advance panel plot
  resP@gsnPanelLabelBar   = False                 ; add common colorbar
  resP@gsnPanelBottom     = 0.05
  resP@lbOrientation="Vertical"  
  resP@pmLabelBarWidthF=0.04  
  resP@pmLabelBarHeightF=0.6
  resP@gsnPanelFigureStrings=(/"(a)","(b)"/)
  resP@gsnPanelFigureStringsFontHeightF=0.01
  resP@gsnPanelFigureStringsPerimOn=False
  resP@amJust="TopLeft"
  gsn_panel(wks,plot,(/2,1/),resP)               ; now draw as one plot
  frame(wks)







微信截图_20190727135929.png
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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