<div dir="ltr">@ Katin,<div><br></div><div>Thanks for your replay, but your suggestion does'nt change any things.</div><div>@ Alex,</div><div><br></div><div>Attached you find my geo_em, namelist.wps and the ncl script that i use. </div><div><br></div><div><br></div><div>Thanks.</div><div><br></div><div>Rabah</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-27 6:47 GMT-04:00 Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>take a look at the web page <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml</a></div><div><br></div><div>—></div><div><p style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-size:13px;line-height:16px"><font face="Arial">If you want to use gsn_add_poly<i style="margin:0px;padding:0px">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)" target="_blank"><strong style="margin:0px;padding:0px">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"><font face="Courier New">plt_res@PanelPlot = True
plt_res@FramePlot = False</font><font face="Arial">
</font></pre><p style="margin:10px 0px 20px;padding:0px;font-size:13px;line-height:16px"><font face="Arial"><font color="#e63b7a"><b>before</b></font><span style="color:rgb(51,51,51)"> you call <strong style="margin:0px;padding:0px">wrf_map_overlays</strong>. Then, call the appropriate gsn_add_poly<i style="margin:0px;padding:0px">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)" target="_blank"><strong style="margin:0px;padding:0px">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)" target="_blank"><strong style="margin:0px;padding:0px">frame</strong></a>(wks) to draw the plot with the attached primitives and advance the frame.</span></font></p></div><div><br></div><div>Bye,</div><div>Karin</div><div><div class="h5"><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>Am 27.05.2015 um 05:51 schrieb Alex Schaefer <<a href="mailto:alexander.schaefer@mines.sdsmt.edu" target="_blank">alexander.schaefer@mines.sdsmt.edu</a>>:</div><br><div><div style="word-wrap:break-word">Rabah,<div><br></div><div>So if you don’t put them both both res and pltres you still end up with 2 plots?</div><div><br></div><div>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><br></div><div>pm_id = gsn_add_polymarker(wks,plot,npres@ref_lon,npres@ref_lat,mpres)</div><div><br></div><div>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><br></div><div>-Alex</div><div><br></div><div><br></div><div><br><div><div>On May 26, 2015, at 7:06 PM, Rabah Hachelaf <<a href="mailto:hachelaf@sca.uqam.ca" target="_blank">hachelaf@sca.uqam.ca</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">Hi Alex ,<div><br></div><div>When i add </div><div><div> opts@gsnDraw = False</div><div> opts@gsnFrame = False </div></div><div> or </div><div><div> res@gsnDraw = False</div><div> res@gsnFrame = False </div></div><div><br></div><div>and also </div><div><br></div><div><div> pltres@gsnDraw = False</div><div> pltres@gsnFrame = False </div></div><div><br></div><div>I get only grid with the box and the marker like attached. </div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-26 20:47 GMT-04:00 Alex Schaefer <span dir="ltr"><<a href="mailto:alexander.schaefer@mines.sdsmt.edu" target="_blank">alexander.schaefer@mines.sdsmt.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Rabah,<div><br></div><div>Where in your script did you add the resources suggested by Jared?</div><div><br></div><div>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><font color="#888888"><div><br></div><div>-Alex</div></font></span><div><div><div><br></div><div><br><div><div>On May 26, 2015, at 6:36 PM, Rabah Hachelaf <<a href="mailto:hachelaf@sca.uqam.ca" target="_blank">hachelaf@sca.uqam.ca</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">Hi Jared,<div><br></div><div>Thanks for your reponse,</div><div><br></div><div>But add </div><div><br></div><div><br></div><div><div style="font-size:12.8000001907349px">res@gsnDraw = False<br></div><span style="font-size:12.8000001907349px">res@gsnFrame = False</span><br></div><div><br></div><div>doesn't change any things. </div><div><br></div><div>Rabah</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-26 18:34 GMT-04:00 Jared Lee <span dir="ltr"><<a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi Rabah,<br><br></div>I believe what you're missing is these two lines where you set other 'res' resources:<br><br></div>res@gsnDraw = False<br></div>res@gsnFrame = False<br><br></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><br></div><div>Hope that helps.<br></div><div><br></div>Jared<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div>On Tue, May 26, 2015 at 4:21 PM, Rabah Hachelaf <span dir="ltr"><<a href="mailto:hachelaf@sca.uqam.ca" target="_blank">hachelaf@sca.uqam.ca</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr"><div><br></div><div><br></div><div>Hello NCL users,</div><div><br></div><div>I am using the script below to plot a box and a marker dot over topography field from WRF outputs,</div><div><br></div><div>My problem is i can not get one figure, i get two separate figures like attached. </div><div><br></div><div>Any suggestion to solve this.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>; Example script - plot terrain (using some basic WRF scripts)</div><div>; Overwrite basic map background settings</div><div>; November 2008</div><div><br></div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div><div><br></div><div>begin</div><div><br></div><div> a = addfile("../<a href="http://geo_em.d02.nc/" target="_blank">geo_em.d02.nc</a>","r") ; Open a file</div><div> filename = "../namelist.wps"</div><div><br></div><div> npres= True</div><div> npres@ref_lat = stringtofloat(systemfunc("grep ref_lat " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )</div><div> npres@ref_lon = stringtofloat(systemfunc("grep ref_lon " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )</div><div><br></div><div> type = "png"</div><div> wks = gsn_open_wks(type,"plt_geo_6") ; Create a plot workstation</div><div><br></div><div><br></div><div> opts = True ; Set some Basic Plot options</div><div> opts@MainTitle = "GEOGRID FIELDS"</div><div> opts@InitTime = False ; Do not plot time or footers</div><div> opts@Footer = False </div><div><br></div><div> ter = wrf_user_getvar(a,"HGT_M",0) ; Read the variable to memory</div><div> lon = a->XLONG_U(0,:,:)</div><div> lat = a->XLAT_U(0,:,:)</div><div> printVarSummary(lat) </div><div> </div><div> print (lat(0,0)+", "+lon(0,0)+",0,")</div><div> print (lat(0,60)+", "+lon(0,60)+",0,")</div><div> print (lat(59,60)+", "+lon(59,60)+",0,")</div><div> print (lat(59,0)+", "+lon(59,0)+",0")</div><div> </div><div> </div><div> res = opts ; Use basic options for this field</div><div> res@cnFillOn = True ; Create a color fill plot</div><div> res@ContourParameters = (/ 0., 1000., 50. /) ; Set the levels</div><div><br></div><div> contour = wrf_contour(a,wks,ter,res)</div><div><br></div><div> pltres = True ; Set plot options</div><div> mpres = True ; Set map options</div><div> mpres@mpGeophysicalLineColor = "Black" ; Overwrite basic map settings</div><div> mpres@mpGridLineColor = "Black"</div><div> mpres@mpLimbLineColor = "Black"</div><div> mpres@mpNationalLineColor = "Black"</div><div> mpres@mpPerimLineColor = "Black"</div><div> mpres@mpUSStateLineColor = "Black"</div><div> mpres@mpProjection = "LambertConformal"</div><div> mpres@mpLambertParallel1F = 30</div><div> mpres@mpLambertParallel2F = 60 </div><div> mpres@mpLambertMeridianF = -98</div><div> mpres@mpGridSpacingF = 0.25</div><div>;************************************************</div><div>; add the box</div><div>;************************************************</div><div>;************************************************</div><div> ypts = (/ lat(10,10), lat(10,50), lat(49,50), lat(49,10), lat(10,10)/)</div><div> xpts = (/ lon(10,10), lon(10,50), lon(49,50), lon(49,10), lon(10,10)/)</div><div>;************************************************</div><div><br></div><div> resp = True ; polyline mods desired</div><div> resp@gsLineColor = "black" ; color of lines</div><div> resp@gsLineThicknessF = 2.0 ; thickness of lines</div><div>; resp@gsLineLabelString= "test" ; adds a line label string</div><div> </div><div><br></div><div> </div><div> plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) ; Plot field over map background</div><div> </div><div> </div><div> dum = new(4,graphic) </div><div> do i = 0 , 3</div><div> dum(i)=gsn_add_polyline(wks,plot,xpts(i:i+1),ypts(i:i+1),resp) </div><div> end do </div><div>;********************************************************* </div><div> mpres@gsMarkerColor = "Black"</div><div> mpres@gsMarkerIndex = 16</div><div> mpres@gsMarkerSizeF = 0.005</div><div> gsn_polymarker(wks,plot,npres@ref_lon,npres@ref_lat,mpres)</div><div> </div><div> draw(plot)</div><div> frame(wks)</div><div> </div><div>end</div><span><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div></div>
</font></span></div>
<br></div>_______________________________________________<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"><br>-- <br><div><div dir="ltr"><div><div><div><div><div><font face="courier new, monospace">===============================<br>Jared A. Lee, Ph.D.<br></font></div><font face="courier new, monospace">Project Scientist I<br></font></div><font face="courier new, monospace">Research Applications Laboratory<br></font></div><font face="courier new, monospace">National Center for Atmospheric Research<br>Boulder, Colorado, USA<br><br></font></div><font face="courier new, monospace">Email: <a href="mailto:jaredlee@ucar.edu" target="_blank">jaredlee@ucar.edu</a> (w)<br></font></div><font face="courier new, monospace">Phone: 303.497.8485 (w)</font><div><font face="courier new, monospace">Web: <a href="https://staff.ucar.edu/users/jaredlee" target="_blank">https://staff.ucar.edu/users/jaredlee</a><br>===============================</font><br></div></div></div>
</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><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div></div>
</div>
_______________________________________________<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></div></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div><div><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><div><br></div></div></span></div></div></div></div></div><br><br>
</div>
<br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div></div>
</div>