<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
David<br>
Thanks. I believe I understand the issue now. If you use
gsn_add_polyline it works. If you use gsn_ployline, it works if you
put it after the draw(map) as it is immediately drawing (unlike the
gsn_add_polyline ).<br>
<br>
Sorry for the confusion. I didn't understand the difference between
the two routines but do now.<br>
<br>
Cathy<br>
<br>
<br>
<div class="moz-cite-prefix">On 8/4/14 5:15 PM, David Brown wrote:<br>
</div>
<blockquote
cite="mid:CAC92F7c8inb8e_LvyurRyxfAiNHACAopwt8t2_ee9DrKABjUNA@mail.gmail.com"
type="cite">
<div dir="ltr">You do not need to set any "DrawOrder" 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 "map" 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"><<a
moz-do-not-send="true" href="mailto:asphilli@ucar.edu"
target="_blank">asphilli@ucar.edu</a>></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 =
"Draw" and pres@tfPolyDrawOrder = "PostDraw" 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'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"><<a
moz-do-not-send="true"
href="mailto:cathy.smith@noaa.gov"
target="_blank">cathy.smith@noaa.gov</a>></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"><<a moz-do-not-send="true"
href="mailto:asphilli@ucar.edu"
target="_blank">asphilli@ucar.edu</a>></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 =
"PostDraw". That resource should control
when the polylines are drawn. If that
doesn'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"><<a
moz-do-not-send="true"
href="mailto:cathy.smith@noaa.gov"
target="_blank">cathy.smith@noaa.gov</a>></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'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 moz-do-not-send="true"
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'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"><<a
moz-do-not-send="true"
href="mailto:ksgriffin2@wisc.edu"
target="_blank">ksgriffin2@wisc.edu</a>></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 =
"PreDraw"</div>
<div><br>
</div>
<div>If that doesn't do it,
you can poke around with
other DrawOrder resources to
move things into either
"PreDraw", "Draw", or
"PostDraw" 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
moz-do-not-send="true"
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"><<a
moz-do-not-send="true"
href="mailto:cathy.smith@noaa.gov"
target="_blank">cathy.smith@noaa.gov</a>></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'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 moz-do-not-send="true"
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'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
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
;**************************************************<br>
begin<br>
<br>
psname="fluffy"<br>
wks =
gsn_open_wks("ps",psname)
; open
workstation<br>
res = True
;
map resources<br>
res@gsnDraw = False
;
don't draw<br>
res@gsnFrame = False
;
don'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 moz-do-not-send="true"
href="tel:303-497-6263"
value="+13034976263"
target="_blank">303-497-6263</a><br>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true" href="tel:303-497-6263" value="+13034976263" target="_blank">303-497-6263</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true"
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
moz-do-not-send="true"
href="http://www.cgd.ucar.edu/staff/asphilli/"
target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>
</font></span><span><font
color="#888888"><a
moz-do-not-send="true"
href="tel:303-497-1726"
value="+13034971726"
target="_blank">303-497-1726</a>
</font></span></div>
<span></span>
<div>
<div><span><font
color="#888888"><br>
</font></span>
<div><span></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 moz-do-not-send="true" href="tel:303-497-6263" value="+13034976263" target="_blank">303-497-6263</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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
moz-do-not-send="true"
href="http://www.cgd.ucar.edu/staff/asphilli/"
target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>
</font></span><span><font color="#888888"><a
moz-do-not-send="true"
href="tel:303-497-1726" value="+13034971726"
target="_blank">303-497-1726</a> </font></span></div>
<span></span>
<div>
<div><span><font color="#888888"><br>
</font></span>
<div><span></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a moz-do-not-send="true"
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>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
<a class="moz-txt-link-freetext" href="http://www.esrl.noaa.gov/psd/people/cathy.smith/">http://www.esrl.noaa.gov/psd/people/cathy.smith/</a>
Emails about data/webpages may get quicker responses from emailing
<a class="moz-txt-link-abbreviated" href="mailto:esrl.psd.data@noaa.gov">esrl.psd.data@noaa.gov</a></pre>
</body>
</html>