[pyngl-talk] Fill color between 2 lines with Ngl.xy

Fearon, Dr. Matthew, Contractor, Code 7533 matthew.fearon.ctr at nrlmry.navy.mil
Fri Aug 24 12:06:46 MDT 2018


Just a follow-up. I have learned that fill color between 2 adjacent lines with Ngl.xy works nicely for an exclusive xy plot. However, it does not work as an overlay to a contour plot when sfXArray/sfYArray or sfYCStart/End/ and sfXCStart/End are used in the original contour plot.  Individual xy lines with Ngl.xy can be overlain on a contour plot with no trouble, but fill color between them does not work.

Any help on this subject would be great.
Thanks,
Matt


From: pyngl-talk [mailto:pyngl-talk-bounces at ucar.edu] On Behalf Of Fearon, Dr. Matthew, Contractor, Code 7533 via pyngl-talk
Sent: Thursday, August 23, 2018 12:28 PM
To: pyngl-talk at ucar.edu
Subject: [pyngl-talk] Fill color between 2 lines with Ngl.xy

Hi, PyNGL Users,

I'm trying to indicate the terrain profile on the attached cross section plot. I am able overlay an xy line (black, terrain top) and another xy line (red, ground surface), but am unable to fill color between these two lines. All the combinations I have tried are not working. Below is my Ngl.xy code for the overlay. Any help is greatly appreciated.

Thanks,
Matt

-----
xvar[100] is a np array of the xvalues
pter[2,100] is a np array of the yvalues

    xyres                        = Ngl.Resources()
    xyres.nglFrame               = False
    xyres.nglDraw                = False
    xyres.xyLineColors           = ["black","red"]
    xyres.xyLineThicknesses      = [8,8]
    xyres.nglXYFillColors        = ["red","red"]
    xyres.nglXYBelowFillColors   = ["red","red"]
    xyres.nglXYAboveFillColors   = ["red","red"]

    xyline = Ngl.xy(wks,xvar,pter,xyres)

    Ngl.overlay(plot,xyline)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20180824/3868dc45/attachment.html>


More information about the pyngl-talk mailing list