<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Li,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When you set "tmXBValues", these values have to be in the same data space as your X axes. If the tickmarks are not showing up, then this is always the first thing I check for. Since I can't run your script, I don't know what your X axes values look like and whether they are being set correctly.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To debug this, I suggest temporarily commenting out all the "tm" resource settings, so you can see what the default axes labels look like. This will show you the actual range of your X axes. I would also draw "contour_dbz" by itself, before you call wrf_overlays, so you can make sure the overlay isn't the source of the issue:</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">contour_dbz = wrf_contour(a,wks,dbz_plane(0:zmax_pos,:),opts_dbz)</div>
<div>draw(contour_dbz)</div><div>frame(wks)</div><div><br></div><div>If you continue to have problems with this, it would help if you could provide the data files needed for running this script.</div><div><br></div><div>Thanks,</div>
<div><br></div><div>--Mary</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 22, 2014 at 7:02 PM, Li Qi <span dir="ltr"><<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi!</div><div><br></div><div>I referred to this example (<a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/CROSS_SECTION/wrf_CrossSection4.htm" target="_blank">http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/CROSS_SECTION/wrf_CrossSection4.htm</a>) to plot dbz along an arbitrary cross section, but the longitude tick marks didn't show up (as shown below).<span style="line-height:0px"></span></div>
<div><img src="cid:33EF6D3E@58B89F56.A209CF53.jpg" style="width:690px;min-height:137px"></div><div>this is example:</div><div><img src="cid:BA8DD705@58B89F56.A209CF53.jpg"></div><div>I don't know how to fix it. Any advice will be greatly appreciated!</div>
<div><br></div><div>Here's my code:</div><div><div>; This script will plot data at a set angle through a specified point</div><div>; This script adds lon/lat info along X-axis</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>;</div><div>; The WRF ARW input file. </div><div>; This needs to have a ".nc" appended, so just do it.</div>
<div> a = addfile("./<a href="http://wrfout_d03_2011-06-13_18_00_00.nc" target="_blank">wrfout_d03_2011-06-13_18_00_00.nc</a>","r")</div><div><br></div><div><br></div><div>; We generate plots, but what kind do we prefer?</div>
<div>; type = "x11"</div><div>; type = "pdf"</div><div> type = "eps"</div><div>; type = "ncgm"</div><div>wks = gsn_open_wks(type,"cross_dbz_lh")</div><div>gsn_define_colormap(wks, "dbz") </div>
<div><br></div><div><br></div><div>; Set some basic resources</div><div>res = True</div><div>res@NoHeaderFooter = True ; Switch headers and footers off</div><div><br></div><div>pltres = True</div><div>
<br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div>FirstTime = True</div><div>FirstTimeMap = True</div><div>times = wrf_user_list_times(a) ; get times in the file</div><div>ntimes = dimsizes(times) ; number of times in the file</div>
<div><br></div><div>mdims = getfilevardimsizes(a,"P") ; get some dimension sizes for the file</div><div>nd = dimsizes(mdims)</div><div><br></div><div>xlat = wrf_user_getvar(a, "XLAT",0)</div><div>xlon = wrf_user_getvar(a, "XLONG",0)</div>
<div>ter = wrf_user_getvar(a, "HGT",0)</div><div><br></div><div>;---------------------------------------------------------------</div><div><br></div><div>do it = 26,28 ; TIME LOOP</div><div><br>
</div><div>print("Working on time: " + times(it) )</div><div>res@TimeLabel = times(it) ; Set Valid time to use on plots</div><div><br></div><div><br></div><div> dbz = wrf_user_getvar(a,(/"dbz","1","1"/),it)</div>
<div> dbz@description = ""</div><div> dbz@units = ""<span style="white-space:pre-wrap">        </span></div><div><br></div><div>z = wrf_user_getvar(a, "z",it) ; grid point height</div><div><br>
</div><div>if ( FirstTime ) then ; get height info for labels</div><div>zmin = 0.</div><div>zmax = 15. ; We are only interested in the first zmax km</div><div>nz = floattoint(zmax + 1)</div><div>end if</div><div><br></div>
<div>;---------------------------------------------------------------</div><div><br></div><div>;crsa=58.10lat,-140.4lon; crsb=59.15lat,-137.15lon;</div><div>lat = (/27.8, 29.3/)</div><div>lon = (/115.7, 119./) ; user specified coordinate pairs</div>
<div>nm = getind_latlon2d (xlat,xlon, lat, lon) ; return 2d subscripts</div><div><br></div><div>angle=0</div><div>plane = new(4,float)</div><div>plane = (/ nm(0,1),nm(0,0), nm(1,1),nm(1,0) /) ; approx. start x;y and end x;y point</div>
<div>opts = True</div><div><br></div><div>X_plane = wrf_user_intrp2d(xlon,plane,0,opts)</div><div>X_desc = "longitude"</div><div><br></div><div>dbz_plane = wrf_user_intrp3d(dbz,z,"v",plane,0,opts)</div>
<div><br></div><div><br></div><div>; Find the index where 15km is - only need to do this once</div><div>if ( FirstTime ) then</div><div>zz = wrf_user_intrp3d(z,z,"v",plane,0,opts)</div><div>b = ind(zz(:,0) .gt. zmax*1000. )</div>
<div>zmax_pos = b(0) - 1</div><div>if ( abs(zz(zmax_pos,0)-zmax*1000.) .lt. abs(zz(zmax_pos+1,0)-zmax*1000.) ) then</div><div>zspan = b(0) - 1</div><div>else</div><div>zspan = b(0)</div><div>end if</div><div>delete(zz)</div>
<div>delete(b)</div><div>FirstTime = False</div><div>end if</div><div><br></div><div>; X-axis lables</div><div>dimsX = dimsizes(X_plane)</div><div>xmin = X_plane(0)</div><div>xmax = X_plane(dimsX(0)-1)</div><div>xspan = dimsX(0)-1</div>
<div>nx = floattoint( (xmax-xmin)/2 + 1)</div><div><br></div><div>; Options for XY Plots</div><div>opts_xy = res</div><div>opts_xy@tiXAxisString = X_desc</div><div>opts_xy@tiYAxisString = "Height (km)"</div><div>
opts_xy@cnMissingValPerimOn = True</div><div>opts_xy@cnMissingValFillColor = 0</div><div>opts_xy@cnMissingValFillPattern = 11</div><div>opts_xy@tmXTOn = False</div><div>opts_xy@tmYROn = False</div><div>opts_xy@tmXBMode = "Explicit"</div>
<div>opts_xy@tmXBValues = fspan(0,xspan,nx) ; Create tick marks</div><div>opts_xy@tmXBLabels = sprintf("%.1f",fspan(xmin,xmax,nx)) ; Create labels</div><div>opts_xy@tmXBLabelFontHeightF = 0.015</div><div>opts_xy@tmYLMode = "Explicit"</div>
<div>opts_xy@tmYLValues = fspan(0,zspan,nz) ; Create tick marks</div><div>opts_xy@tmYLLabels = sprintf("%.1f",fspan(zmin,zmax,nz)) ; Create labels</div><div>opts_xy@tiXAxisFontHeightF = 0.020</div><div>opts_xy@tiYAxisFontHeightF = 0.020</div>
<div>opts_xy@tmXBMajorLengthF = 0.02</div><div>opts_xy@tmYLMajorLengthF = 0.02</div><div>opts_xy@tmYLLabelFontHeightF = 0.015</div><div>opts_xy@PlotOrientation = dbz_plane@Orientation</div><div><br></div><div><br></div><div>
<br></div><div>;---------------------------------------------------------------</div><div>; Plotting options for DBZ</div><div>opts_dbz = opts_xy</div><div>opts_dbz@ContourParameters = (/ 15., 50., 5. /)</div><div>opts_dbz@pmLabelBarOrthogonalPosF = -0.1</div>
<div>opts_dbz@cnFillOn = True</div><div>opts_dbz@lbLabelBarOn = False ; Turn off individual label bars</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>
<br></div><div><br></div><div>; Get the contour info for the dbz</div><div>contour_dbz = wrf_contour(a,wks,dbz_plane(0:zmax_pos,:),opts_dbz)</div><div><br></div><div><br></div><div>;---------------------------------------------------------------</div>
<div><br></div><div>; MAKE PLOTS </div><div><br></div><div>plot = wrf_overlays(a,wks,(/contour_dbz/),pltres) ; plot x-section</div><div><br></div><div><br></div><div>; Delete options and fields, so we don't have carry over</div>
<div>delete(opts_xy)</div><div>delete(opts_dbz)</div><div><br></div><div>delete(dbz_plane)</div><div><br></div><div>delete(X_plane)</div><div><br></div><div><br></div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div>
<div><br></div><div>FirstTimeMap = False</div><div>end do ; END OF TIME LOOP</div><div><br></div><div>end<span style="line-height:0px"></span></div></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></div>