爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 111|回复: 2

[作图] NCL多折线图问题(莫名其妙的一根线

[复制链接]

新浪微博达人勋

发表于 4 天前 | 显示全部楼层 |阅读模式
40金钱
用ncl绘制多折线图,多出来一根越出绘图边界的直线(紫色的那个直线)
不知道是哪里的问题,恳请各位大佬指点!!
barnes-scheme.png
代码如下:
begin
    R=new((/4,30/),float)
    g=0.3
    c=(/10000,30000,60000,90000/)

    waveL=ispan(100,3000,100)
    pai=3.1415926
    ; 计算响应函数
    do ir=0,dimsizes(c)-1
        do iw=0,dimsizes(waveL)-1
            R0=exp(-4 * pai^2 * c(ir) / waveL(iw)^2)
            R(ir,iw)=R0*(1 + R0^(g-1) - R0^g)
        end do
    end do

    ;------plot kind------
    type="x11"
    ;type="png"
    ;type="pdf"

    ;------creat workstation------
    wks=gsn_open_wks(type, "barnes-scheme")   

    ; 绘图
    res=True
    res@gsnDraw=False
    res@gsnFrame=False

    res@trYMaxF=1
    res@trYMinF=0

    res@vpXF=0.2
    res@vpYF=0.9
    res@vpHeightF=0.7
    res@vpWidthF=0.7
    res@tmBorderThicknessF=7


    ; 叠加折线
    res2=res
    res2@tmXTOn=False
    res2@tmYROn=False

    res2@tiYAxisString="Response Function"
    res2@tiYAxisFontHeightF=0.03
    res2@tiYAxisOffsetXF=0.012
    res2@tiXAxisString="WaveLength (10^2 km)"
    res2@tiXAxisFontHeightF=0.03

    res2@tmXTOn=False
    res2@tmYROn=False
    res2@tmXBLabelFontHeightF = 0.03         ; Default is a bit large
    res2@tmYLLabelFontHeightF = 0.03
    res2@tmXBLabelDeltaF=-0.8
    res2@tmYLLabelDeltaF=-0.7
    ;res2@tmXBLabelJust="TopLeft"
    res2@tmXBMajorLengthF=0.01
    res2@tmXBMajorOutwardLengthF=0.01
    res2@tmXBMajorThicknessF=6
    res2@tmXBMinorOn=False
    res2@tmYLMajorLengthF=0.01
    res2@tmYLMajorOutwardLengthF=0.01
    res2@tmYLMajorThicknessF=6
    res2@tmYLMinorOn=False

    res2@gsnXYBarChart=False
    colors=(/"brown2","forestgreen","dodgerblue","darkviolet"/)
    res2@xyLineColors=colors
    res2@pmLegendDisplayMode="Always"   ; 图例
    res2@pmLegendWidthF=0.1
    res2@pmLegendHeightF=0.12
    res2@pmLegendOrthogonalPosF=-0.4
    res2@pmLegendParallelPosF=0.84
    res2@xyExplicitLegendLabels=(/"c=10000","c=30000","c=60000","c=90000"/)
    res2@lgPerimOn=False
    res2@lgLabelFontHeightF=0.02
    res2@lbBoxMinorExtentF=0.3
    res2@lgItemOrder=(/3,2,1,0/)

    res2@xyDashPattern=0
    res2@xyLineThicknessF=6
    ;run_ave=runave_Wrap(ave(1:,:), 4, 0)   ; 折线平滑
    res2@gsnLeftString ="Barnes Filtering Scheme"
    res2@gsnLeftStringFontHeightF=0.03
    res2@gsnLeftStringOrthogonalPosF=-0.015
    res2@gsnRightString=""
    plot=gsn_csm_xy(wks,waveL/100,R,res2)

    draw(plot)
    frame(wks)
end


barnes-scheme.png

最佳答案

查看完整内容

R = where(R.eq."-nan",R@_FillValue,R)
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 4 天前 | 显示全部楼层
    R = where(R.eq."-nan",R@_FillValue,R)
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 昨天 19:28 | 显示全部楼层
lyq. 发表于 2024-10-21 12:18
R = where(R.eq."-nan",R@_FillValue,R)

非常感谢!成功了
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

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

本版积分规则

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

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

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