<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Marston,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for the clarification, I understand now!</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don't think you are barking up the wrong tree, but the tree may have some errors. :-)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In order to draw a polygon, you need to provide a closed loop. Maybe try:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"> ypt =(/-50.0,-50.0,-27.5,-27.5,-50.0/)</div><div class="gmail_default"> xpt =(/0.0,19.0,19.0,0.0,0.0/)</div><div class="gmail_default"> polyres = True </div><div class="gmail_default"> polyres@gsFillColor = "black"</div><div class="gmail_default"> polyres@gsFillIndex = 3</div><div class="gmail_default"> polyres@gsFillOpacityF = 0.2</div><div class="gmail_default"> dum2 = gsn_add_polygon(wks,plot(0),xpt,ypt,polyres) ; add polygon</div><div class="gmail_default"><br></div><div class="gmail_default">Since I already had an example of doing an overlay where the different curves have different axes limits, I took that and added your hatching code. But, I commented out the gsFillIndex and made it just a fill color instead. See the attached.</div><div class="gmail_default"><br></div><div class="gmail_default">Were you trying to do both fill *and* hatching? If so, I think you have to do them separately, because you can't specify both a fill color and a hatch pattern for a single polygon call:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> ypt =(/-50.0,-50.0,-27.5,-27.5,-50.0/)</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> xpt =(/0.0,19.0,19.0,0.0,0.0/)</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> polyres = True </div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> polyres@gsFillColor = "black"</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> polyres@gsFillOpacityF = 0.2<br></div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> dum2_fill = gsn_add_polygon(wks,plot(0),xpt,ypt,polyres) ; add polygon</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)"> polyres@gsFillIndex = 3</div></div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> dum2_hatch = gsn_add_polygon(wks,plot(0),xpt,ypt,polyres) ; add polygon</span><br class="gmail-Apple-interchange-newline"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 1:37 PM, Marston Ward <span dir="ltr"><<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;line-break:after-white-space">
Hi Jared & Mary,
<div><br>
</div>
<div>Thanks for the responses. These are all good and show, for me, new ways to use NCL.</div>
<div>Unfortunately, as Jared pointed out, I’m not trying to hatch my figure based on the contours values.</div>
<div>I’m working on a publication so forgive me if I hesitate to send to all of ncl-talk. Let me explain a bit more.</div>
<div><br>
</div>
<div>I have to two panel containing 2 plots, but these plots have x-axis of different lengths (just by 1 value) e.g., plot 1 has a x-value from 0:10 and plot 2: 1:10.</div>
<div>Since I’m comparing model results with observations I would like to put a hatch box over the plot 1 between x= 0 and x= 1 so that the reader can still see the contours beneath but note the different ranges of the plots.</div>
<div><br>
</div>
<div>The examples Mary suggested didn’t really cover this example. apologies for not being more clear first time around. </div>
<div><br>
</div>
<div>I tried the following with the thought of adding a box with hatch fill between x= 0 and x=1 but zero effect later when I plot the panel.</div>
<div><br>
</div>
<div>
<div> ypt =(/-50.0,-27.5/)</div>
<div> xpt =(/0.0,19.0/)</div>
<div> polyres = True </div>
<div> polyres@gsFillColor = "black"</div>
<div> polyres@gsFillIndex = 3</div>
<div> polyres@gsFillOpacityF = 0.2</div>
<div> dum2 = gsn_add_polygon(wks,plot(0),<wbr>xpt,ypt,polyres) ; add polygon</div>
<div><br>
</div>
</div>
<div>Am I barking up the wrong tree here or am I making an error somewhere?</div>
<div><br>
</div>
<div>Appreciate the help guys,</div>
<div>/M</div><div><div class="h5">
<div><br>
<div><br>
<blockquote type="cite">
<div>On 8 Mar 2018, at 18:30, Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> wrote:</div>
<br class="m_8995897632907894666Apple-interchange-newline">
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Marston,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">If you simply want to draw hatching on top of an existing contour plot, then you can use gsn_contour_shade. </div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small"><a href="http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_contour_shade.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Graphics/Interfaces/<wbr>gsn_contour_shade.shtml</a></div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">This function is for the sole purpose of taking an existing contour plot, and adding some hatching or stippling to highlight an area of interest.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Here are some examples:</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/conOncon.shtml#ex4" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/conOncon.shtml#<wbr>ex4</a><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/coneff.shtml#ex11" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/coneff.shtml#ex11</a><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/overlay.shtml#ex5" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/overlay.shtml#ex5</a><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/wavelet.shtml#ex3" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/wavelet.shtml#ex3</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Some of these may not use gsn_contour_shade.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Let ncl-talk know if this is not what you're after.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">--Mary</div>
<div class="gmail_default"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Mar 8, 2018 at 3:47 AM, Marston Ward <span dir="ltr">
<<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51)">
Hi,</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51);min-height:16px">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51)">
I’m trying to mask a part of a gsn_csm_contour plot using a “hatch”. I don’t want to simply mask out the area because I want to the data to still be visible under the hatch.</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51)">
Is it possible to do this in NCL? A simple search returned nothing in NCL. Just wondering if this is possible and it so, are there examples.</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51);min-height:16px">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51)">
Best,</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51)">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(51,51,51)">
/M</div>
</div>
<div name="messageSignatureSection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br>
<p class="MsoNormal"><b><i>Marston S. Ward</i></b><br>
</p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></div>
</blockquote></div><br></div>