<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">take a look at the web page <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml</a></div><div class=""><br class=""></div><div class="">—></div><div class=""><p style="margin: 10px 0px 20px; padding: 0px; color: rgb(51, 51, 51); font-size: 13px; line-height: 16px;" class=""><font face="Arial" class="">If you want to use gsn_add_poly<i style="margin: 0px; padding: 0px;" class="">xxxx</i> routines (like <a href="https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polymarker.shtml" style="margin: 0px; padding: 0px; text-decoration: none; color: rgb(133, 45, 133);" class=""><strong style="margin: 0px; padding: 0px;" class="">gsn_add_polymarker</strong></a>) to add primtives to a WRF plot, then you need to set:</font></p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13px; line-height: 16px; border-style: solid; border-width: 0px 0px 15px; border-color: transparent;" class=""><font face="Courier New" class="">plt_res@PanelPlot = True
plt_res@FramePlot = False</font><font face="Arial" class="">
</font></pre><p style="margin: 10px 0px 20px; padding: 0px; font-size: 13px; line-height: 16px;" class=""><font face="Arial" class=""><font color="#e63b7a" class=""><b class="">before</b></font><span style="color: rgb(51, 51, 51);" class=""> you call <strong style="margin: 0px; padding: 0px;" class="">wrf_map_overlays</strong>. Then, call the appropriate gsn_add_poly<i style="margin: 0px; padding: 0px;" class="">xxxx</i> routine to attach the desired primitives, and finally call <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/draw.shtml" style="margin: 0px; padding: 0px; text-decoration: none; color: rgb(133, 45, 133);" class=""><strong style="margin: 0px; padding: 0px;" class="">draw</strong></a>(plot) and <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/frame.shtml" style="margin: 0px; padding: 0px; text-decoration: none; color: rgb(133, 45, 133);" class=""><strong style="margin: 0px; padding: 0px;" class="">frame</strong></a>(wks) to draw the plot with the attached primitives and advance the frame.</span></font></p></div><div class=""><br class=""></div><div class="">Bye,</div><div class="">Karin</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 27.05.2015 um 05:51 schrieb Alex Schaefer <<a href="mailto:alexander.schaefer@mines.sdsmt.edu" class="">alexander.schaefer@mines.sdsmt.edu</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Rabah,<div class=""><br class=""></div><div class="">So if you don’t put them both both res and pltres you still end up with 2 plots?</div><div class=""><br class=""></div><div class="">It might also be worth trying to use the gsn_add_polymarker as opposed to using the gsn-polymarker. gsn_polymarker might have the frame internally built. The gsn_add_polymarker does return an identifier so you would do it similar to your polyline call:</div><div class=""><br class=""></div><div class="">pm_id = gsn_add_polymarker(wks,plot,npres@ref_lon,npres@ref_lat,mpres)</div><div class=""><br class=""></div><div class="">If this doesn’t work can you attach your geo_em file and script and I will see if I can see what is going on.</div><div class=""><br class=""></div><div class="">-Alex</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class="">On May 26, 2015, at 7:06 PM, Rabah Hachelaf <<a href="mailto:hachelaf@sca.uqam.ca" class="">hachelaf@sca.uqam.ca</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite" class=""><div dir="ltr" class="">Hi Alex ,<div class=""><br class=""></div><div class="">When i add </div><div class=""><div class=""> opts@gsnDraw = False</div><div class=""> opts@gsnFrame = False </div></div><div class=""> or </div><div class=""><div class=""> res@gsnDraw = False</div><div class=""> res@gsnFrame = False </div></div><div class=""><br class=""></div><div class="">and also </div><div class=""><br class=""></div><div class=""><div class=""> pltres@gsnDraw = False</div><div class=""> pltres@gsnFrame = False </div></div><div class=""><br class=""></div><div class="">I get only grid with the box and the marker like attached. </div><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-05-26 20:47 GMT-04:00 Alex Schaefer <span dir="ltr" class=""><<a href="mailto:alexander.schaefer@mines.sdsmt.edu" target="_blank" class="">alexander.schaefer@mines.sdsmt.edu</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Rabah,<div class=""><br class=""></div><div class="">Where in your script did you add the resources suggested by Jared?</div><div class=""><br class=""></div><div class="">Since you have a bunch of different resource objects you will need to set it in each going into plots controlling plot resources. For you this should include res or opts and likely pltres.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">-Alex</div></font></span><div class=""><div class="h5"><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class="">On May 26, 2015, at 6:36 PM, Rabah Hachelaf <<a href="mailto:hachelaf@sca.uqam.ca" target="_blank" class="">hachelaf@sca.uqam.ca</a>> wrote:</div><br class=""><blockquote type="cite" class=""><div dir="ltr" class="">Hi Jared,<div class=""><br class=""></div><div class="">Thanks for your reponse,</div><div class=""><br class=""></div><div class="">But add </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="font-size:12.8000001907349px" class="">res@gsnDraw = False<br class=""></div><span style="font-size:12.8000001907349px" class="">res@gsnFrame = False</span><br class=""></div><div class=""><br class=""></div><div class="">doesn't change any things. </div><div class=""><br class=""></div><div class="">Rabah</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-05-26 18:34 GMT-04:00 Jared Lee <span dir="ltr" class=""><<a href="mailto:jaredlee@ucar.edu" target="_blank" class="">jaredlee@ucar.edu</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class="">Hi Rabah,<br class=""><br class=""></div>I believe what you're missing is these two lines where you set other 'res' resources:<br class=""><br class=""></div>res@gsnDraw = False<br class=""></div>res@gsnFrame = False<br class=""><br class=""></div>By default they're both set to True, which would give you two separate images. If you set both to false you should get a single plot with your polymarker overlaid.<br class=""><br class=""></div><div class="">Hope that helps.<br class=""></div><div class=""><br class=""></div>Jared<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote"><div class="">On Tue, May 26, 2015 at 4:21 PM, Rabah Hachelaf <span dir="ltr" class=""><<a href="mailto:hachelaf@sca.uqam.ca" target="_blank" class="">hachelaf@sca.uqam.ca</a>></span> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Hello NCL users,</div><div class=""><br class=""></div><div class="">I am using the script below to plot a box and a marker dot over topography field from WRF outputs,</div><div class=""><br class=""></div><div class="">My problem is i can not get one figure, i get two separate figures like attached. </div><div class=""><br class=""></div><div class="">Any suggestion to solve this.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">; Example script - plot terrain (using some basic WRF scripts)</div><div class="">; Overwrite basic map background settings</div><div class="">; November 2008</div><div class=""><br class=""></div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div><div class=""><br class=""></div><div class="">begin</div><div class=""><br class=""></div><div class=""> a = addfile("../<a href="http://geo_em.d02.nc/" target="_blank" class="">geo_em.d02.nc</a>","r") ; Open a file</div><div class=""> filename = "../namelist.wps"</div><div class=""><br class=""></div><div class=""> npres= True</div><div class=""> npres@ref_lat = stringtofloat(systemfunc("grep ref_lat " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )</div><div class=""> npres@ref_lon = stringtofloat(systemfunc("grep ref_lon " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )</div><div class=""><br class=""></div><div class=""> type = "png"</div><div class=""> wks = gsn_open_wks(type,"plt_geo_6") ; Create a plot workstation</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> opts = True ; Set some Basic Plot options</div><div class=""> opts@MainTitle = "GEOGRID FIELDS"</div><div class=""> opts@InitTime = False ; Do not plot time or footers</div><div class=""> opts@Footer = False </div><div class=""><br class=""></div><div class=""> ter = wrf_user_getvar(a,"HGT_M",0) ; Read the variable to memory</div><div class=""> lon = a->XLONG_U(0,:,:)</div><div class=""> lat = a->XLAT_U(0,:,:)</div><div class=""> printVarSummary(lat) </div><div class=""> </div><div class=""> print (lat(0,0)+", "+lon(0,0)+",0,")</div><div class=""> print (lat(0,60)+", "+lon(0,60)+",0,")</div><div class=""> print (lat(59,60)+", "+lon(59,60)+",0,")</div><div class=""> print (lat(59,0)+", "+lon(59,0)+",0")</div><div class=""> </div><div class=""> </div><div class=""> res = opts ; Use basic options for this field</div><div class=""> res@cnFillOn = True ; Create a color fill plot</div><div class=""> res@ContourParameters = (/ 0., 1000., 50. /) ; Set the levels</div><div class=""><br class=""></div><div class=""> contour = wrf_contour(a,wks,ter,res)</div><div class=""><br class=""></div><div class=""> pltres = True ; Set plot options</div><div class=""> mpres = True ; Set map options</div><div class=""> mpres@mpGeophysicalLineColor = "Black" ; Overwrite basic map settings</div><div class=""> mpres@mpGridLineColor = "Black"</div><div class=""> mpres@mpLimbLineColor = "Black"</div><div class=""> mpres@mpNationalLineColor = "Black"</div><div class=""> mpres@mpPerimLineColor = "Black"</div><div class=""> mpres@mpUSStateLineColor = "Black"</div><div class=""> mpres@mpProjection = "LambertConformal"</div><div class=""> mpres@mpLambertParallel1F = 30</div><div class=""> mpres@mpLambertParallel2F = 60 </div><div class=""> mpres@mpLambertMeridianF = -98</div><div class=""> mpres@mpGridSpacingF = 0.25</div><div class="">;************************************************</div><div class="">; add the box</div><div class="">;************************************************</div><div class="">;************************************************</div><div class=""> ypts = (/ lat(10,10), lat(10,50), lat(49,50), lat(49,10), lat(10,10)/)</div><div class=""> xpts = (/ lon(10,10), lon(10,50), lon(49,50), lon(49,10), lon(10,10)/)</div><div class="">;************************************************</div><div class=""><br class=""></div><div class=""> resp = True ; polyline mods desired</div><div class=""> resp@gsLineColor = "black" ; color of lines</div><div class=""> resp@gsLineThicknessF = 2.0 ; thickness of lines</div><div class="">; resp@gsLineLabelString= "test" ; adds a line label string</div><div class=""> </div><div class=""><br class=""></div><div class=""> </div><div class=""> plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) ; Plot field over map background</div><div class=""> </div><div class=""> </div><div class=""> dum = new(4,graphic) </div><div class=""> do i = 0 , 3</div><div class=""> dum(i)=gsn_add_polyline(wks,plot,xpts(i:i+1),ypts(i:i+1),resp) </div><div class=""> end do </div><div class="">;********************************************************* </div><div class=""> mpres@gsMarkerColor = "Black"</div><div class=""> mpres@gsMarkerIndex = 16</div><div class=""> mpres@gsMarkerSizeF = 0.005</div><div class=""> gsn_polymarker(wks,plot,npres@ref_lon,npres@ref_lat,mpres)</div><div class=""> </div><div class=""> draw(plot)</div><div class=""> frame(wks)</div><div class=""> </div><div class="">end</div><span class=""><font color="#888888" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div dir="ltr" class=""><div class="">------------------------------</div>Cordialement,<br class="">Best regards,<br class="">Rabah Hachelaf <br class=""></div></div>
</font></span></div>
<br class=""></div>_______________________________________________<br class="">
ncl-talk mailing list<br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
<br class=""></blockquote></div><span class=""><font color="#888888" class=""><br class=""><br clear="all" class=""><br class="">-- <br class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><font face="courier new, monospace" class="">===============================<br class="">Jared A. Lee, Ph.D.<br class=""></font></div><font face="courier new, monospace" class="">Project Scientist I<br class=""></font></div><font face="courier new, monospace" class="">Research Applications Laboratory<br class=""></font></div><font face="courier new, monospace" class="">National Center for Atmospheric Research<br class="">Boulder, Colorado, USA<br class=""><br class=""></font></div><font face="courier new, monospace" class="">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank" class="">jaredlee@ucar.edu</a> (w)<br class=""></font></div><font face="courier new, monospace" class="">Phone: 303.497.8485 (w)</font><div class=""><font face="courier new, monospace" class="">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank" class="">https://staff.ucar.edu/users/jaredlee</a><br class="">===============================</font><br class=""></div></div></div>
</font></span></div>
<br class="">_______________________________________________<br class="">
ncl-talk mailing list<br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div dir="ltr" class=""><div class="">------------------------------</div>Cordialement,<br class="">Best regards,<br class="">Rabah Hachelaf <br class=""></div></div>
</div>
_______________________________________________<br class="">ncl-talk mailing list<br class="">List instructions, subscriber options, unsubscribe:<br class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class=""></blockquote></div><br class=""></div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div><div apple-content-edited="true" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div></div></span></div></div></div></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>