<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 &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</div><div><br></div><div>begin</div><div><br></div><div>  a = addfile(&quot;../<a href="http://geo_em.d02.nc">geo_em.d02.nc</a>&quot;,&quot;r&quot;) Â  Â  Â  Â  Â  ; Open a file</div><div>  filename = &quot;../namelist.wps&quot;</div><div><br></div><div>  npres= True</div><div>  npres@ref_lat Â  = stringtofloat(systemfunc(&quot;grep ref_lat Â  Â &quot; +filename+ &quot; | cut -f2 -d&#39;=&#39; | cut -f1 -d&#39;,&#39;&quot; ) )</div><div>  npres@ref_lon Â  = stringtofloat(systemfunc(&quot;grep ref_lon Â  Â &quot; +filename+ &quot; | cut -f2 -d&#39;=&#39; | cut -f1 -d&#39;,&#39;&quot; ) )</div><div><br></div><div> type = &quot;png&quot;</div><div>  wks = gsn_open_wks(type,&quot;plt_geo_6&quot;) Â  Â  Â  Â  ; Create a plot workstation</div><div><br></div><div><br></div><div>  opts = True Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ; Set some Basic Plot options</div><div>  opts@MainTitle = &quot;GEOGRID FIELDS&quot;</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,&quot;HGT_M&quot;,0) Â  Â  Â  Â  Â  ; Read the variable to memory</div><div>  lon = a-&gt;XLONG_U(0,:,:)</div><div>  lat = a-&gt;XLAT_U(0,:,:)</div><div> printVarSummary(lat) </div><div> </div><div> print (lat(0,0)+&quot;, &quot;+lon(0,0)+&quot;,0,&quot;)</div><div> print (lat(0,60)+&quot;, &quot;+lon(0,60)+&quot;,0,&quot;)</div><div> print (lat(59,60)+&quot;, &quot;+lon(59,60)+&quot;,0,&quot;)</div><div> print (lat(59,0)+&quot;, &quot;+lon(59,0)+&quot;,0&quot;)</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 Â  Â  Â = &quot;Black&quot; Â ; Overwrite basic map settings</div><div>  mpres@mpGridLineColor Â  Â  Â  Â  Â  Â  = &quot;Black&quot;</div><div>  mpres@mpLimbLineColor Â  Â  Â  Â  Â  Â  = &quot;Black&quot;</div><div>  mpres@mpNationalLineColor Â  Â  Â  Â  = &quot;Black&quot;</div><div>  mpres@mpPerimLineColor Â  Â  Â  Â  Â  Â = &quot;Black&quot;</div><div>  mpres@mpUSStateLineColor Â  Â  Â  Â  Â = &quot;Black&quot;</div><div>  Â  Â mpres@mpProjection = &quot;LambertConformal&quot;</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 Â  Â  Â = &quot;black&quot; Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ; color of lines</div><div>  resp@gsLineThicknessF = 2.0 Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ; thickness of lines</div><div>; Â resp@gsLineLabelString= &quot;test&quot; Â  Â  Â  Â  Â  Â  Â  Â  Â  Â ; 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 = &quot;Black&quot;</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><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div></div>
</div>