<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Wei,<br></div>I just tested this method and it worked:<br><br></div>res@gsnDraw = False<br>res@gsnFrame = False<br></div>plot = gsn_map(wks,res)<br></div><br>; create polylines/polygons/polymarkers using gsn_add_*<br></div><br>draw(plot)<br></div><br>wmdrft(wks, xlat, xlon)   ; Draw front<br></div>...   ; draw other fronts<br></div><br>frame(wks)<br><div><div><div><div><div><div><div><br></div><div>Adam<br></div><div><div><br></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 15, 2015 at 11:10 AM, Wei Huang <span dir="ltr">&lt;<a href="mailto:whuang@univ-wea.com" target="_blank">whuang@univ-wea.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Adam,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">That did not work.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white"><b><span style="font-size:17.0pt;font-family:&quot;Lucida Handwriting&quot;;color:#1f497d">Wei Huang</span></b><span style="font-size:9.5pt;font-family:&quot;Lucida Handwriting&quot;;color:#222222"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Adam Phillips [mailto:<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>]
<br>
<b>Sent:</b> Wednesday, July 15, 2015 12:05 PM<br>
<b>To:</b> Wei Huang<br>
<b>Cc:</b> David Brown; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Add polyline, polygon, and polytext to a map generates two PNG files.<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi Wei,<u></u><u></u></p>
</div>
<p class="MsoNormal">Try adding:<u></u><u></u></p>
</div>
<p class="MsoNormal">res@mpFillDrawOrder = &quot;PreDraw<strong>&quot;</strong><u></u><u></u></p>
</div>
<p class="MsoNormal">and let ncl-talk know if that doesn&#39;t work.<u></u><u></u></p>
</div>
<p class="MsoNormal">Adam<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Jul 15, 2015 at 11:00 AM, Wei Huang &lt;<a href="mailto:whuang@univ-wea.com" target="_blank">whuang@univ-wea.com</a>&gt; wrote:<u></u><u></u></p>
<p class="MsoNormal">Dave,<br>
<br>
With your suggestion, everything worked out, until we want a filled map.<br>
<br>
I am working like these<br>
<br>
;define the resource:<br>
<br>
   res                      = True<br>
   res@gsnMaximize          = True<br>
<br>
   res@gsnDraw              = False<br>
   res@gsnFrame             = False<br>
<br>
;define the work station<br>
   wks = gsn_open_wks(&quot;x11&quot;, out_flnm)<br>
<br>
;the map<br>
   map_projection = &quot;Mercator&quot;<br>
<br>
  ;Set some map resources.<br>
   res@mpProjection      = map_projection   ; choose projection<br>
<br>
   res@mpLimitMode       = &quot;LatLon&quot;<br>
   res@mpMinLatF         =  -85.0<br>
   res@mpMaxLatF         =   85.0<br>
   res@mpMinLonF         = -180.0<br>
   res@mpMaxLonF         =  180.0<br>
<br>
      res@mpOutlineBoundarySets = &quot;National&quot;<br>
      res@mpNationalLineColor = 1<br>
      res@mpGridAndLimbOn     = True<br>
<br>
      res@mpLandFillColor        = &quot;Wheat3&quot; ; was &quot;GoldenRod1&quot; or &quot;Tan&quot;<br>
      res@mpOceanFillColor       = &quot;SlateGray2&quot; ; was &quot;LightBlue1&quot;<br>
      res@mpInlandWaterFillColor = &quot;SlateGray2&quot; ; was &quot;LightBlue1&quot;  ; was &quot;PaleTurquoise3&quot;<br>
<br>
Then I draw front as:<br>
  ;print(&quot;xlat = &quot; + xlat + &quot;, xlon = &quot; + xlon)<br>
   wmdrft(wks, xlat, xlon)   ; Draw front.<br>
(and quite few of them)<br>
<br>
And later:<br>
<br>
   pline = gsn_add_polyline(wks, plot, xlon, xlat, p_res)<br>
(and may other similar)<br>
<br>
and finally:<br>
<br>
draw(map)<br>
 frame(wks)<br>
<br>
<br>
Now the front was draw first (without map), and then others draw on map,<br>
And covered the fronts draw on the wks before.<br>
<br>
How can adjust the order to make the front draw last on top of the map?<br>
<br>
Thanks,<br>
<br>
Wei Huang<br>
<br>
<br>
-----Original Message-----<br>
From: David Brown [mailto:<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>]<br>
Sent: Tuesday, July 14, 2015 1:54 PM<br>
To: Wei Huang<br>
Cc: Adam Phillips; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
Subject: Re: [ncl-talk] Add polyline, polygon, and polytext to a map generates two PNG files.<br>
<br>
Wei,<br>
You should use a different set of resources for the poly functions from the ones you use for the gsn_csm_map call.<br>
 -dave<br>
<br>
On Tue, Jul 14, 2015 at 12:18 PM, Wei Huang &lt;<a href="mailto:whuang@univ-wea.com" target="_blank">whuang@univ-wea.com</a>&gt; wrote:<br>
&gt; Adam,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I used gsn_add_* suite for the polylines, polygons, polytexts.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; If I set:<br>
&gt;<br>
&gt;    res                      = True<br>
&gt;<br>
&gt;    res@gsnDraw              = False<br>
&gt;<br>
&gt;   res@gsnFrame             = False<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; It can turn off (eliminate) the blank map, but later, there are a<br>
&gt; whole bunch of warning msgs,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; warning:gsnDraw/gsnFrame is not a valid resource in graphic_style at<br>
&gt; this time.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; This make it hard to read other msgs.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Wei Huang<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; From: Adam Phillips [mailto:<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>]<br>
&gt; Sent: Tuesday, July 14, 2015 1:07 PM<br>
&gt; To: Wei Huang<br>
&gt; Cc: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
&gt; Subject: Re: [ncl-talk] Add polyline, polygon, and polytext to a map<br>
&gt; generates two PNG files.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hi Wei,<br>
&gt;<br>
&gt; It depends on what functions/procedures you are using to draw your<br>
&gt; polylines/markers/text.. In all cases you should set gsnFrame = False<br>
&gt; in your res resource list.<br>
&gt;<br>
&gt; I prefer the gsn_add_* suite of functions to do what you are doing as<br>
&gt; it allows paneling. For those functions you also need to add gsnDraw =<br>
&gt; False to your res resource list.<br>
&gt;<br>
&gt; If you are just using gsn_text/gsn_polygon/gsn_polygon you can get<br>
&gt; away with not setting gsnDraw as is shown in polygon example #8 here:<br>
&gt; <a href="https://www.ncl.ucar.edu/Applications/Scripts/polyg_8.ncl" target="_blank">
https://www.ncl.ucar.edu/Applications/Scripts/polyg_8.ncl</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hope that helps!<br>
&gt;<br>
&gt; Adam<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Jul 14, 2015 at 10:05 AM, Wei Huang &lt;<a href="mailto:whuang@univ-wea.com" target="_blank">whuang@univ-wea.com</a>&gt; wrote:<br>
&gt;<br>
&gt; I am trying to add polyline, polygon, and polytext to a map, steps as below:<br>
&gt;<br>
&gt;   res = ...<br>
&gt;   wks = ...<br>
&gt;    map = gsn_csm_map(wks, res)<br>
&gt;<br>
&gt;  ;add lots of polylines, polygons, and polytexts to map<br>
&gt;<br>
&gt; draw(map)<br>
&gt;  frame(wks)<br>
&gt;<br>
&gt; It generates two PNG files. With the first just a map.<br>
&gt;<br>
&gt; How can I remove the first blank map?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Wei Huang<br>
&gt; <a href="mailto:whuang@univ-wea.com" target="_blank">whuang@univ-wea.com</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt; Adam Phillips<br>
&gt;<br>
&gt; Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR<br>
&gt;<br>
&gt; <a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   <a href="tel:303-497-1726" target="_blank">303-497-1726</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888">Adam Phillips </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="color:#888888">Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   <a href="tel:303-497-1726" value="+13034971726" target="_blank">303-497-1726</a>
</span><u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><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 Laboratory, 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">303-497-1726 </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></div></div></div></div>
</div>