<div dir="ltr"><div class="gmail_default" style="font-size:small">I think you simply need to set these two resources:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">







<p class="gmail-p1"><span class="gmail-s1">        res@</span><span class="gmail-s2">trXMaxF</span><span class="gmail-s1"> = nfiles-0.5</span></p>
<p class="gmail-p1"><span class="gmail-s1">        res@</span><span class="gmail-s2">trXMinF</span><span class="gmail-s1"> = -0.5</span></p><p class="gmail-p1"><span class="gmail-s1">Those two lines you see are the &quot;xc&quot; and &quot;yc&quot; being plotted, and they don&#39;t match the axis because NCL chose a different X min/max for the X axis.  </span></p><p class="gmail-p1">By setting those two resources, you are forcing the X axis to have the same min/max as the &quot;xc&quot; array.</p><p class="gmail-p1">--Mary</p><p class="gmail-p1"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 1, 2016 at 4:00 AM, <a href="mailto:dyjbean@gmail.com">dyjbean@gmail.com</a> <span dir="ltr">&lt;<a href="mailto:dyjbean@gmail.com" target="_blank">dyjbean@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><span></span><br></div>
<div>hi,</div><div> when i plotted wind barb, i  consulted the <a href="http://www.ncl.ucar.edu/Applications/Scripts/barb_6.ncl" style="font-size:10.5pt;line-height:1.5;background-color:window" target="_blank">barb_6.ncl</a> , the following is the figure:</div><div>    <img src="cid:_Foxmail.1@612859e5-7626-6406-3e86-9a7439065186" border="0" style="font-size:10.5pt;line-height:1.5;background-color:window"></div><div>there are 48 times every day including missing value, i extract some times from on day for testing,but i cannot get rid of the two vertical lines,</div><div>according to the barb_6.ncl example, there is no vertical line.</div><div><br></div><div>the following is my script:</div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;</div><div> <span style="background-color:rgba(0,0,0,0);font-size:10.5pt;line-height:1.5">load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot; </span></div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)">load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot; <br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl&quot;<br><br>begin<br>ymin = 150.            ; min <wbr>height to be plotted<br>  ymax = 3030.            ; <wbr>max height to be plotted<br>  ncol = 3                ; <wbr>number of columns of data (<wbr>Each ascii file has the same <wbr>number of columns)<br>  wbcrit = 100.            ; <wbr>minimum distance in meters <wbr>between wind barbs <br><br>  fils = systemfunc(&quot;ls test*.txt&quot;)<br>  nfiles = dimsizes(fils)<br>  print(nfiles)<br>  <br>  wks = gsn_open_wks(&quot;png&quot;,&quot;<wbr>barb_test_jsy&quot;)     ; send <wbr>graphics to PNG file<br>  gsn_define_colormap(wks,&quot;<wbr>WhBlGrYeRe&quot;)<br>  do gg = 0,nfiles-1<br>     t = asciiread(fils(gg) ,(<wbr>/-1/), &quot;float&quot;)<br>     nlvl = dimsizes(t)/ncol  <wbr>         ; figure out number <wbr>of levels in the ascii file<br>     delete(t)<br>     TestData = asciiread(<wbr>fils(gg) ,(/nlvl,ncol/), &quot;<wbr>float&quot;)<br>     z    = TestData (:,0)  ; <wbr>1200<br>     wspd = TestData (:,2)<br>     wdir = TestData (:,1)<br>     wspd@_FillValue = -999.0<br>     wdir@_FillValue = -999.0<br>     delete(TestData)<br><br>     ;printMinMax(wspd, 0)<br>     ;printMinMax(wdir, 0)<br><br>     rad = 4.0*atan(1.0)/180.<br>     u = -wspd*sin(rad*wdir)<br>     v = -wspd*cos(rad*wdir)<br>     u@_FillValue = -999.0<br>     v@_FillValue = -999.0<br>     printMinMax(u, 0)<br>     printMinMax(v, 0)<br>        <br>     if (gg.eq.0) then<br>        res = True<br>        res@gsnDraw = False<br>        res@gsnFrame = False<br>        res@vpWidthF = 0.7<br>        res@vpHeightF = 0.5<br>        res@vpXF = 0.15<br>        res@vpYF = 0.9<br>        res@trYMinF = ymin<br>        res@trYMaxF = ymax<br>        res@tmXBMode = &quot;<wbr>Explicit&quot;<br>        res@tmXBValues = <wbr>ispan(0,nfiles-1,1)<br>        ; res@tmXBValues = <wbr>ispan(0,47,1);ispan(0,nfiles-<wbr>1,1)<br>        ; res@tmXBLabels = (/&quot;<wbr>00Z&quot;,&quot;0:30Z&quot;,&quot;01Z&quot;,&quot;01:30Z&quot;,&quot;<wbr>02Z&quot;,&quot;02:30Z&quot;,&quot;03Z&quot;,&quot;03:30Z&quot;,&quot;<wbr>04Z&quot;,&quot;04:30Z&quot;,&quot;05Z&quot;,&quot;05:30Z&quot;,&quot;<wbr>06Z&quot;,\<br>        ;               &quot;06:<wbr>30Z&quot;,&quot;07Z&quot;,&quot;07:30Z&quot;,&quot;08Z&quot;,&quot;08:<wbr>30Z&quot;,&quot;09Z&quot;,&quot;09:30Z&quot;,&quot;10Z&quot;,&quot;10:<wbr>30Z&quot;,&quot;11Z&quot;,&quot;11:30Z&quot;,&quot;12Z&quot;,&quot;12:<wbr>30Z&quot;,&quot;13Z&quot;,\<br>        ;               &quot;13:<wbr>30Z&quot;,&quot;14Z&quot;,&quot;14:30Z&quot;,&quot;15Z&quot;,&quot;15:<wbr>30Z&quot;,&quot;16Z&quot;,&quot;16:30Z&quot;,&quot;17Z&quot;,&quot;17:<wbr>30Z&quot;,&quot;18Z&quot;,&quot;18:30Z&quot;,&quot;19Z&quot;,&quot;19:<wbr>30Z&quot;,&quot;20Z&quot;,\<br>        ;               &quot;20:<wbr>30Z&quot;,&quot;21Z&quot;,&quot;21:30Z&quot;,&quot;22Z&quot;,&quot;22:<wbr>30Z&quot;,&quot;23Z&quot;,&quot;23:30Z&quot;/)<br>        res@tmXBLabels = (/&quot;<wbr>00Z&quot;,&quot;0:30Z&quot;,&quot;01Z&quot;,&quot;01:30Z&quot;,&quot;<wbr>02Z&quot;,&quot;02:30Z&quot;,&quot;03Z&quot;,&quot;03:30Z&quot;, <wbr>\<br>                           &quot;<wbr>04Z&quot;,&quot;04:30Z&quot;,&quot;05Z&quot;,&quot;05:30Z&quot;,&quot;<wbr>06Z&quot;, &quot;06:30Z&quot;,&quot;07Z&quot;,&quot;07:30Z&quot;/<wbr>)<br>        res@<wbr>tmXBLabelFontHeightF = 0.008<br><br>        res@tiYAxisString = &quot;<wbr>height (m)&quot;<br>        res@tiXAxisString = &quot;<wbr>time&quot;<br>        res@tiMainString = &quot;<wbr>Wind Profile&quot;<br>        xc = (/-0.5,nfiles-0.<wbr>5,nfiles-0.5,-0.5,-0.5/)<br>        yc = (/ymin,ymin,ymax,<wbr>ymax,ymin/)<br>     <br>        plot = gsn_csm_xy(wks,<wbr>xc,yc,res)                    <wbr>      ; draw blank xy plot by <wbr>outlining min/max of X/Y axes<br>        contours = ispan(1,14,<wbr>1)*1.                         <wbr>      ; set contours used to <wbr>define barb color <br>        colors = (/10,20,30,<wbr>40,45,50,55,60,65,70,75,80,85,<wbr>90,95/)    ; set colors<br>     end if<br>     <br>     wmsetp (&quot;wdf&quot;, 1)        <wbr>         ; meteorological dir<br>     wmsetp(&quot;wbs&quot;,0.025)<br>     wmsetp (&quot;blw&quot;,2.0)    ; <wbr>increase line thickness of <wbr>wind barbs<br>     ;drawNDCGrid(wks)<br>     do hh = 0,dimsizes(z)-1<br>        print(u(hh)+&quot; &quot;+v(hh))<br>        if(.not.ismissing(<wbr>wspd(hh))) then<br>          wmsetp(&quot;col&quot;, <wbr>GetFillColorIndex(contours,<wbr>colors,wspd(hh)))<br>          iFlag = True <br>        else<br>          continue<br>        end if<br><br><br>        if (z(hh).lt.ymax) <wbr>then<br>           if (hh.eq.0) then  <wbr>                              <wbr>   ; always draw the first <wbr>wind barb <br>              wmbarb(wks, gg*<wbr>1., z(hh), u(hh), v(hh)) <br>              iFlag = True    <wbr>                              <wbr>   ; iFlag = True denotes <wbr>that a barb has been drawn<br>           else<br>              if (z(hh)-zsave.<wbr>ge.wbcrit) then               <wbr>   ; if the current height is <wbr>beyond wbcrit from<br>                if ((u(hh).ne.<wbr>wspd@_FillValue).and.(v(hh).<wbr>ne.wspd@_FillValue)) then<br>                 wmbarb(wks, <wbr>gg*1., z(hh), u(hh), v(hh))   <wbr>    ; previous barb height, <wbr>draw barb<br>                 iFlag = True<br>                else<br>                 iFlag = False<br>                end if<br><br>              else<br>                 if (.not.<wbr>iFlag) then                   <wbr>       ; if the previous barb <wbr>has not been drawn,<br>                    if (z(hh)-<wbr>zsave.ge.wbcrit) then         <wbr>   ; and if the last drawn <wbr>barb was more than wbcrit <wbr>away,<br>                        if ((<wbr>u(hh).ne.wspd@_FillValue).and.<wbr>(v(hh).ne.wspd@_FillValue)) <wbr>then<br>                         <wbr>wmbarb(wks, gg*1., z(hh), u(<wbr>hh), v(hh)) ; draw a barb<br>                         <wbr>iFlag = True<br>                        else<br>                         <wbr>iFlag = False<br>                        end if<br>                    else<br>                       iFlag =<wbr> False                        <wbr>   ; set iFlag to False, <wbr>denoting the barb wasn&#39;t drawn<br>                    end if<br>                 else   <br>                    iFlag = <wbr>False<br>                 end if<br>              end if<br>           end if<br>        else  <br>           iFlag = False<br>        end if<br>        if (iFlag) then<br>           zsave = z(hh)      <wbr>                              <wbr>    ; save the height of the <wbr>drawn wind barb<br>        end if<br>     end do<br>     delete([/z,wspd,wdir,u,v/<wbr>])<br>  end do<br><br>;-----------------------------<wbr>------------------------------<wbr>---------------<br>;    Draw Labelbar<br>;-----------------------------<wbr>------------------------------<wbr>--------------- <br>  lbres                      =<wbr> True<br>  lbres@lbPerimOn            =<wbr> False               ; no <wbr>label bar box<br>  lbres@lbOrientation        =<wbr> &quot;Horizontal&quot;        ; <wbr>orientation<br>  lbres@vpWidthF             =<wbr> 0.5                 ; size<br>  lbres@vpHeightF            =<wbr> 0.075<br>  lbres@lbLabelFontHeightF   =<wbr> 0.015               ; label <wbr>font height<br>  lbres@lbLabelAlignment     =<wbr> &quot;InteriorEdges&quot;     ; where <wbr>to label<br>  lbres@lbMonoFillPattern    =<wbr> True                ; fill <wbr>sold<br>  lbres@lbFillColors         =<wbr> colors<br>  gsn_labelbar_ndc (wks,<wbr>dimsizes(contours)+1,sprintf(&quot;<wbr>%3.0f&quot;,contours),0.25,0.30,<wbr>lbres)<br>  <br>  draw(plot)                  <wbr>    ; draw the plot<br>  frame(wks)                  <wbr>      ; advance the frame<br><br><br>end<br></span><div> </div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;</div><div><br></div><div>i don&#39;t know how to get rid of this two lines on figure. i changed number in <span style="font-size:10.5pt;line-height:1.5;background-color:window"> xc = (/-0.5,nfiles-0.5,<wbr>nfiles-0.5,-0.5,-0.5/) , but it cannot take effect.</span></div><div><br></div><div>the attachment is my test data intercepted from a daily file for this checkout.</div><div><br></div><div>any help will be appreciated!</div><div><span style="font-size:10.5pt;line-height:1.5;background-color:window"><br></span></div><div><span style="font-size:10.5pt;line-height:1.5;background-color:window">thanks</span></div><span class="HOEnZb"><font color="#888888"><div><br></div>
<div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><a href="mailto:dyjbean@gmail.com" target="_blank">dyjbean@gmail.com</a></div></div></span></div>
</font></span></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>