<div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>Not really sure what you mean by "...nothing works" -- what result do you get? <br></div><div><br></div><div>On a general note, in your first call to the overlay() function, usually the map-based plot is the first argument, i.e, the basis of the overlay. Finally, the call to maximize_output() is either called in lieu of draw()/frame(), or must be called before draw()/frame(); see the docs at:</div><div><br></div><div> <a href="http://ncl.ucar.edu/Document/Graphics/Interfaces/maximize_output.shtml">http://ncl.ucar.edu/Document/Graphics/Interfaces/maximize_output.shtml</a></div><div><br></div><div>Rick<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 8, 2019 at 10:20 AM Andrea Perez <<a href="mailto:andreaperez151@yahoo.es">andreaperez151@yahoo.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_5924486831479540383ydpd5b25f43yahoo-style-wrap" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><span><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small">Hello, </span><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small">I am using MM5 ouput and I want to plot terrain, wind vector and SST in a map. </div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small">I have tried with a mask, res_base but nothing works. Can any one help me??</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small"><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small">code:</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small"><span><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" </div><div><br></div><div>begin</div><div><span style="white-space:pre-wrap"> </span>f1=addfile("<a href="http://data.nc" target="_blank">data.nc</a>","r")</div><div><br></div><div><span style="white-space:pre-wrap"> </span>lat=f1->latitcrs</div><div><span style="white-space:pre-wrap"> </span>lon=f1->longicrs</div><div><span style="white-space:pre-wrap"> </span>dims=dimsizes(lat)</div><div><span style="white-space:pre-wrap"> </span>lat2d=(/lat/)</div><div><span style="white-space:pre-wrap"> </span>lat2d@units = "degreeN"</div><div><span style="white-space:pre-wrap"> </span>lon2d=(/lon/)</div><div><span style="white-space:pre-wrap"> </span>lon2d@units = "degreeE"</div><div><br></div><div><span style="white-space:pre-wrap"> </span>ter=f1->terrain</div><div><span style="white-space:pre-wrap"> </span>ter@lat2d=lat2d</div><div><span style="white-space:pre-wrap"> </span>ter@lon2d=lon2d</div><div><br></div><div><span style="white-space:pre-wrap"> </span>u=f1->u10</div><div><span style="white-space:pre-wrap"> </span>v=f1->v10</div><div><span style="white-space:pre-wrap"> </span>u@lat2d=lat2d</div><div><span style="white-space:pre-wrap"> </span>u@lon2d=lon2d</div><div><span style="white-space:pre-wrap"> </span>v@lat2d=lat2d</div><div><span style="white-space:pre-wrap"> </span>v@lon2d=lon2d</div><div><span style="white-space:pre-wrap"> </span>med=ter</div><div><br></div><div> ts = f1->tseasfc(24,:,:)</div><div> ts = (ts*1)</div><div> ts@lat2d=lat2d</div><div> ts@lon2d=lon2d</div><div><br></div><div>;******************************************************************************<span style="white-space:pre-wrap"> </span></div><div><span style="white-space:pre-wrap"> </span>wks = gsn_open_wks("eps","terrain_sst") ; open a workstation</div><div>;******************************************************************************</div><div><br></div><div> res = True </div><div> res@gsnDraw = False</div><div> res@gsnFrame = False</div><div> res@mpProjection = "Mercator" </div><div> res@cnLinesOn = False</div><div> res@cnFillOn = True ; color plot desired</div><div> res@mpOutlineDrawOrder = "PostDraw"</div><div> res@mpFillDrawOrder = "Predraw"</div><div> res@gsnSpreadColors = True</div><div> res@cnLevelSelectionMode =<span style="white-space:pre-wrap"> </span>"ManualLevels"</div><div> res@lbLabelAutoStride = True </div><div> res@cnLineLabelsOn = False ; turn off contour lines</div><div> res@cnFillDrawOrder = "Predraw"</div><div> res@mpDataBaseVersion = "HighRes" ; </div><div> </div><div> res@mpProjection = "Mercator" </div><div> res@mpDataBaseVersion = "HighRes"</div><div> res@mpLimitMode = "Corners" ; choose range of map</div><div> res@mpLeftCornerLatF = lat2d(0,0)</div><div> res@mpLeftCornerLonF = lon2d(0,0)</div><div> res@mpRightCornerLatF = lat2d(dims(0)-1,dims(1)-1)</div><div> res@mpRightCornerLonF = lon2d(dims(0)-1,dims(1)-1)</div><div><br></div><div>; res@tfDoNDCOverlay = True</div><div><br></div><div> res@mpGeophysicalLineColor = "black" ; color of continental outlines</div><div> res@mpPerimOn = True ; draw box around map</div><div> res@mpGridLineDashPattern = 2 ; lat/lon lines as dashed</div><div> res@mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state boundaries</div><div> res@mpUSStateLineColor = "black" ; make them red</div><div> res@mpOutlineOn = True</div><div> res@mpDataBaseVersion = "MediumRes"</div><div> res@mpDataSetName = "Earth..4"</div><div> res@mpOutlineBoundarySets = "National"</div><div> res@mpGeophysicalLineColor = "black" ; color of cont. outlines</div><div> res@mpGeophysicalLineThicknessF = 3 ; thickness of outlines</div><div> res@mpNationalLineThicknessF = 3 ; interior boundaries </div><div> </div><div>;**********************************************************</div><div> ter_res = res </div><div>;***********************Terrain****************************</div><div> ter_res@cnMinLevelValF<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap"> </span>0</div><div> ter_res@cnMaxLevelValF<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap"> </span>3000</div><div> ter_res@cnLevelSpacingF = 250 </div><div> ter_res@cnFillPalette = "OceanLakeLandSnow" ; choose colormap</div><div> ter_res@mpFillOn = False </div><div>;**************************SST*****************************</div><div> res_base = res</div><div> res_base@cnFillOn = True ; turn on color fill</div><div> res_base@cnLinesOn = False ; turn off contour lines</div><div> res_base@lbLabelStride = 1 ; every 4th label</div><div><br></div><div> res_base@lbLabelAutoStride = True </div><div> res_base@cnLevelSelectionMode =<span style="white-space:pre-wrap"> </span>"ManualLevels"</div><div> res_base@cnMinLevelValF<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap"> </span>296</div><div> res_base@cnMaxLevelValF<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap"> </span>303</div><div> res_base@cnLevelSpacingF = 1 </div><div> res_base@cnLineLabelsOn = False ; turn off contour lines</div><div> </div><div> res_base@tiMainString = "Draw land ON TOP of contours" ; title</div><div> res_base@cnFillDrawOrder = "Predraw" ; draw contours firs </div><div><br></div><div>;**************Create the two plots************************</div><div><br></div><div> ter_plot = gsn_csm_contour_map(wks,ter,ter_res)</div><div> sst_plot = gsn_csm_contour(wks,ts,res_base)</div><div><br></div><div>;*************Overlay the sst plot on the terrain plot*****</div><div> overlay(sst_plot,ter_plot)</div><div><br></div><div>;---Drawing the terrain plot will also draw dbz plot</div><div> draw(ter_plot)</div><div> frame(wks)</div><div><br></div><div> </div><div>;---Remove the dbz plot from terrain plot so we can re-overlay it on a new plot</div><div> NhlRemoveOverlay(ter_plot,sst_plot,False)</div><div><br></div><div>;---Recreate the terrain plot with a fully opaque labelbar</div><div> ter_res@lbOverrideFillOpacity = True ; don't apply opacity to labelbar colors</div><div> ; (NCL V6.4.0 and later)</div><div> ter_plot = gsn_csm_contour_map(wks,ts,ter_res)</div><div> </div><div>;--Re-overlay the dbz plot on the new terrain plot.</div><div> overlay(ter_plot,sst_plot)</div><div><br></div><div>;---Drawing the terrain plot will also draw dbz plot</div><div> draw(ter_plot)</div><div> frame(wks)</div><div><br></div><div> maximize_output(wks,True)</div><div><br></div><div>end</div></span><br></div></span></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>