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

Mary Haley haley at ucar.edu
Thu Aug 30 16:57:40 MDT 2018


Hi Matt,

I'm looking into this one; I don't think we have an example in our gallery,
but I'll try to create one to see if it works.

--Mary


On Fri, Aug 24, 2018 at 12:06 PM, Fearon, Dr. Matthew, Contractor, Code
7533 via pyngl-talk <pyngl-talk at ucar.edu> wrote:

> 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)
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20180830/f6ab69a4/attachment.html>


More information about the pyngl-talk mailing list