<div dir="ltr">You do not need to set any &quot;DrawOrder&quot; resources to get what you want. I think the issue here is the ordering of the calls. gsn_polyline is an immediate mode call, meaning that it draws as soon as it is called. <div>
<br><div><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon1,poly_lon2/),(/poly_lat1,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat1/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon2,poly_lon2/),(/poly_lat1,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat2/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon1,poly_lon2/),(/poly_lat2,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat2/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon1,poly_lon1/),(/poly_lat1,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat2/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">draw(map)</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div>
<span style="font-family:arial,sans-serif;font-size:13px">This sequence of calls draws 4 polylines and then draws the map. If you want the lines on top, you should just put the draw(map) call before the polyline calls.</span></div>
<div><font face="arial, sans-serif">(The frame call should not be commented out, but It should be placed after the polyline calls.):</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">draw(map)</font></div>
<div><font face="arial, sans-serif"><br></font></div><div><div><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon1,poly_lon2/),(/poly_lat1,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat1/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon2,poly_lon2/),(/poly_lat1,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat2/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon1,poly_lon2/),(/poly_lat2,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat2/),pres)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">gsn_polyline(wks,map,(/poly_</span><span style="font-family:arial,sans-serif;font-size:13px">lon1,poly_lon1/),(/poly_lat1,</span><span style="font-family:arial,sans-serif;font-size:13px">poly_lat2/),pres)</span></div>
<div><br></div><div>frame(wks)<br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div><span style="font-family:arial,sans-serif">On the other hand, if you use gsn_add_polyline you are adding the polylines as components of the &quot;map&quot; graphic object. The lines are drawn when you call draw(map). So in this case,</span><br>
</div><div><font face="arial, sans-serif">you do need to have the polyline calls in front of the draw(map) call:</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><div>  d1 = gsn_add_polyline(wks,map,(/poly_lon1,poly_lon2/),(/poly_lat1,poly_lat1/),pres)</div>
<div><br></div><div>  d2 = gsn_add_polyline(wks,map,(/poly_lon2,poly_lon2/),(/poly_lat1,poly_lat2/),pres)</div><div><br></div><div>  d3 = gsn_add_polyline(wks,map,(/poly_lon1,poly_lon2/),(/poly_lat2,poly_lat2/),pres)</div>
<div><br></div><div>  d4 = gsn_add_polyline(wks,map,(/poly_lon1,poly_lon1/),(/poly_lat1,poly_lat2/),pres)</div><div><br></div><div>   draw(map)</div><div>   frame(wks)</div><div><br></div><div>Hope this helps.</div><div> -dave</div>
<div><br></div><div><br></div></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br>
</font></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Aug 4, 2014 at 3:25 PM, Adam Phillips <span dir="ltr">&lt;<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Hi Cathy,<br></div>That is strange. I would think the res@mpFillDrawOrder = &quot;Draw&quot; and pres@tfPolyDrawOrder = &quot;PostDraw&quot; combination would definitely work. I just tried running things here, and I was able to plot the polylines over the map fill by swapping gsn_polyline for gsn_add_polyline. <br>


<br></div>I&#39;m not sure why one would have to do that; perhaps a developer can chime in here.<span class="HOEnZb"><font color="#888888"><br><div>Adam<br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Aug 4, 2014 at 3:13 PM, Cathy Smith - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:cathy.smith@noaa.gov" target="_blank">cathy.smith@noaa.gov</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Adam<div>I tried that and got the same behavior (lines behind shading)</div><div><br></div><div>Cathy</div>


<div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Aug 4, 2014 at 3:08 PM, Adam Phillips <span dir="ltr">&lt;<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="ltr"><div>Hi Cathy,<br>Try setting pres@tfPolyDrawOrder = &quot;PostDraw&quot;. That resource should control when the polylines are drawn. If that doesn&#39;t solve it let everyone know. <br></div>Adam<br></div>



<div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, Aug 4, 2014 at 3:01 PM, Cathy Smith - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:cathy.smith@noaa.gov" target="_blank">cathy.smith@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div dir="ltr">I tried res@mpFillDrawOrder  (which I think is what you were referring to; the other doesn&#39;t exist)<br>

<br>

I set to PreDraw, Draw and Post Draw and got the same behavior. I did see some doc here<br>

<br>

<a href="http://www.ncl.ucar.edu/Applications/draworder.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/draworder.shtml</a><br>

<br>

which is along the lines of what you suggested but didn&#39;t seem to work 
for the routines I used. I wonder if there is a way to draw the 
polylines last instead of the shaded fill first?<br>

<br>

Thanks for the suggestion.<br>

<br>

Cathy<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 4, 2014 at 2:43 PM, Kyle Griffin <span dir="ltr">&lt;<a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I believe the quick fix, assuming nothing else is explicitly ordered, will be<div><br></div><div>res@mpDrawOrder = &quot;PreDraw&quot;</div>






<div><br></div><div>If that doesn&#39;t do it, you can poke around with other DrawOrder resources to move things into either &quot;PreDraw&quot;, &quot;Draw&quot;, or &quot;PostDraw&quot; drawing phases.</div>

<div><br></div><div><br></div><div>Kyle</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div>








<div>University of Wisconsin - Madison</div><div>Room 1421</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div>
<br><br><div class="gmail_quote">On Mon, Aug 4, 2014 at 3:28 PM, Cathy Smith (NOAA Affiliate) <span dir="ltr">&lt;<a href="mailto:cathy.smith@noaa.gov" target="_blank">cathy.smith@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








Hi NCLers<br>
I&#39;m having trouble getting a polyline to appear OVER a map with<br>
continents shaded. I have simplified code below which reproduces the<br>
problem.  The code draws a basic map (shading is default) and then a box<br>
on the map using gsn_polyline . You can run code and then look at<br>
<a href="http://fluffy.ps" target="_blank">fluffy.ps</a>. The box just shows up where there is no shading. I verified<br>
in testing that the lines show up as long as they aren&#39;t located where<br>
the shading is. How can I control the order of shading so it is done<br>
before the polylines?<br>
<br>
NCL version is 6.2.0 on a 64 bit linux server.<br>
<br>
Thanks!<br>
Cathy Smith<br>
<br>
<br>
;*;************************************************<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>
;**************************************************<br>
begin<br>
<br>
   psname=&quot;fluffy&quot;<br>
   wks = gsn_open_wks(&quot;ps&quot;,psname)               ; open workstation<br>
   res            = True                          ; map resources<br>
   res@gsnDraw    = False                         ; don&#39;t draw<br>
   res@gsnFrame   = False                         ; don&#39;t advance frame<br>
   res_lb         = True                          ; map resources<br>
   latmin=41<br>
   latmax=52<br>
   lonmin=235<br>
   lonmax=250<br>
   poly_lat1=43<br>
   poly_lat2=50<br>
   poly_lon1=237<br>
   poly_lon2=247<br>
   res@mpMaxLatF  = latmax                           ; select subregion<br>
   res@mpMinLatF  = latmin<br>
   res@mpMinLonF  = lonmin<br>
   res@mpMaxLonF  = lonmax<br>
   res@mpCenterLonF  = (lonmax+lonmin)/2.<br>
<br>
   map = gsn_csm_map_ce(wks,res)                         ; create map<br>
<br>
   pres                  = True                             ; polyline<br>
resources<br>
   pres@gsLineThicknessF = 2.0                ; line thickness<br>
<br>
<br>
gsn_polyline(wks,map,(/poly_lon1,poly_lon2/),(/poly_lat1,poly_lat1/),pres)<br>
<br>
gsn_polyline(wks,map,(/poly_lon2,poly_lon2/),(/poly_lat1,poly_lat2/),pres)<br>
<br>
gsn_polyline(wks,map,(/poly_lon1,poly_lon2/),(/poly_lat2,poly_lat2/),pres)<br>
<br>
gsn_polyline(wks,map,(/poly_lon1,poly_lon1/),(/poly_lat1,poly_lat2/),pres)<br>
<br>
   draw(map)<br>
;   frame(wks)<br>
<br>
end<br>
<br>
--<br>
----------------------------------------------<br>
NOAA/ESRL PSD and CU CIRES<br>
<a href="tel:303-497-6263" value="+13034976263" target="_blank">303-497-6263</a><br>
<a href="http://www.esrl.noaa.gov/psd/people/cathy.smith/" target="_blank">http://www.esrl.noaa.gov/psd/people/cathy.smith/</a><br>
<br>
Emails about data/webpages may get quicker responses from emailing<br>
<a href="mailto:esrl.psd.data@noaa.gov" target="_blank">esrl.psd.data@noaa.gov</a><br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><pre cols="72">---------------------------------------------------
NOAA/ESRL PSD and CIRES CDC
<a href="tel:303-497-6263" value="+13034976263" target="_blank">303-497-6263</a>
<a href="http://www.esrl.noaa.gov/psd/people/cathy.smith/" target="_blank">http://www.esrl.noaa.gov/psd/people/cathy.smith/</a>

Emails about data/webpages may get quicker responses from emailing </pre><pre cols="72"><a href="mailto:esrl.psd.data@noaa.gov" target="_blank">esrl.psd.data@noaa.gov</a></pre>
</font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><br>-- <br><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div>

<span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Division, NCAR<br>


</font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888"><a href="tel:303-497-1726" value="+13034971726" target="_blank">303-497-1726</a> </font></span></div>





<span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div>




</div>
</div></div>
</font></span></font></span></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><pre cols="72">---------------------------------------------------
NOAA/ESRL PSD and CIRES CDC
<a href="tel:303-497-6263" value="+13034976263" target="_blank">303-497-6263</a>
<a href="http://www.esrl.noaa.gov/psd/people/cathy.smith/" target="_blank">http://www.esrl.noaa.gov/psd/people/cathy.smith/</a>

Emails about data/webpages may get quicker responses from emailing </pre><pre cols="72"><a href="mailto:esrl.psd.data@noaa.gov" target="_blank">esrl.psd.data@noaa.gov</a></pre>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Division, NCAR<br>


</font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888"><a href="tel:303-497-1726" value="+13034971726" target="_blank">303-497-1726</a> </font></span></div>


<span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div>

</div>
</div></div>
</div>
</div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>