<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Handwriting";
        panose-1:3 1 1 1 1 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Adam,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></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"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></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:asphilli@ucar.edu]
<br>
<b>Sent:</b> Wednesday, July 15, 2015 12:05 PM<br>
<b>To:</b> Wei Huang<br>
<b>Cc:</b> David Brown; ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Add polyline, polygon, and polytext to a map generates two PNG files.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi Wei,<o:p></o:p></p>
</div>
<p class="MsoNormal">Try adding:<o:p></o:p></p>
</div>
<p class="MsoNormal">res@mpFillDrawOrder = &quot;PreDraw<strong>&quot;</strong><o:p></o:p></p>
</div>
<p class="MsoNormal">and let ncl-talk know if that doesn't work.<o:p></o:p></p>
</div>
<p class="MsoNormal">Adam<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></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:<o:p></o:p></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>
&nbsp; &nbsp;res&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True<br>
&nbsp; &nbsp;res@gsnMaximize&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True<br>
<br>
&nbsp; &nbsp;res@gsnDraw&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = False<br>
&nbsp; &nbsp;res@gsnFrame&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= False<br>
<br>
;define the work station<br>
&nbsp; &nbsp;wks = gsn_open_wks(&quot;x11&quot;, out_flnm)<br>
<br>
;the map<br>
&nbsp; &nbsp;map_projection = &quot;Mercator&quot;<br>
<br>
&nbsp; ;Set some map resources.<br>
&nbsp; &nbsp;res@mpProjection&nbsp; &nbsp; &nbsp; = map_projection&nbsp; &nbsp;; choose projection<br>
<br>
&nbsp; &nbsp;res@mpLimitMode&nbsp; &nbsp; &nbsp; &nbsp;= &quot;LatLon&quot;<br>
&nbsp; &nbsp;res@mpMinLatF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; -85.0<br>
&nbsp; &nbsp;res@mpMaxLatF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; &nbsp;85.0<br>
&nbsp; &nbsp;res@mpMinLonF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= -180.0<br>
&nbsp; &nbsp;res@mpMaxLonF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; 180.0<br>
<br>
&nbsp; &nbsp; &nbsp; res@mpOutlineBoundarySets = &quot;National&quot;<br>
&nbsp; &nbsp; &nbsp; res@mpNationalLineColor = 1<br>
&nbsp; &nbsp; &nbsp; res@mpGridAndLimbOn&nbsp; &nbsp; &nbsp;= True<br>
<br>
&nbsp; &nbsp; &nbsp; res@mpLandFillColor&nbsp; &nbsp; &nbsp; &nbsp; = &quot;Wheat3&quot; ; was &quot;GoldenRod1&quot; or &quot;Tan&quot;<br>
&nbsp; &nbsp; &nbsp; res@mpOceanFillColor&nbsp; &nbsp; &nbsp; &nbsp;= &quot;SlateGray2&quot; ; was &quot;LightBlue1&quot;<br>
&nbsp; &nbsp; &nbsp; res@mpInlandWaterFillColor = &quot;SlateGray2&quot; ; was &quot;LightBlue1&quot;&nbsp; ; was &quot;PaleTurquoise3&quot;<br>
<br>
Then I draw front as:<br>
&nbsp; ;print(&quot;xlat = &quot; &#43; xlat &#43; &quot;, xlon = &quot; &#43; xlon)<br>
&nbsp; &nbsp;wmdrft(wks, xlat, xlon)&nbsp; &nbsp;; Draw front.<br>
(and quite few of them)<br>
<br>
And later:<br>
<br>
&nbsp; &nbsp;pline = gsn_add_polyline(wks, plot, xlon, xlat, p_res)<br>
(and may other similar)<br>
<br>
and finally:<br>
<br>
draw(map)<br>
&nbsp;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">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">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>
&nbsp;-dave<br>
<br>
On Tue, Jul 14, 2015 at 12:18 PM, Wei Huang &lt;<a href="mailto:whuang@univ-wea.com">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;&nbsp; &nbsp; res&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True<br>
&gt;<br>
&gt;&nbsp; &nbsp; res@gsnDraw&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = False<br>
&gt;<br>
&gt;&nbsp; &nbsp;res@gsnFrame&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 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">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">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">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;&nbsp; &nbsp;res = ...<br>
&gt;&nbsp; &nbsp;wks = ...<br>
&gt;&nbsp; &nbsp; map = gsn_csm_map(wks, res)<br>
&gt;<br>
&gt;&nbsp; ;add lots of polylines, polygons, and polytexts to map<br>
&gt;<br>
&gt; draw(map)<br>
&gt;&nbsp; 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">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">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,&nbsp; 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>&nbsp; &nbsp;<a href="tel:303-497-1726">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">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;<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888">Adam Phillips </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#888888">Associate Scientist,&nbsp; Climate and Global Dynamics Laboratory, NCAR</span><o:p></o:p></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>&nbsp;&nbsp; 303-497-1726
</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>