<div dir="ltr"><div class="gmail_default" style="font-size:small">Hello,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">NCL always tries to use "nice" values on the X and Y axis. It will still plot the data correctly, but you'll get a little bit of a margin.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you don't want the margin, then use the trX/Y/Min/MaxF resources to force the actual minimum and/or maximum that you want.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For example, in your case, if you want to set the maximum of the X axis to the actual maximum of your X array, then set:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">res2@trXMaxF = max(x)<br></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px">before you call gsn_xy.</span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px">By the way, if you want your tickmarks to point outward, you might try using gsn_csm_xy instead of gsn_xy.</span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px">You can see the differences between the gsn_xy and gsn_csm_xy functions by visiting these two example pages:</span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div><div style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px">gsn_csm_xxx: </span><span style="font-size:12.8px"><a href="http://www.ncl.ucar.edu/Applications/xy.shtml">http://www.ncl.ucar.edu/Applications/xy.shtml</a></span></font></div><div style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><font face="monospace, monospace">gsn_xxx: <a href="http://www.ncl.ucar.edu/Applications/generic_xy.shtml">http://www.ncl.ucar.edu/Applications/generic_xy.shtml</a></font></span></div><div style="font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div>--Mary</div><div class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 12, 2018 at 10:15 PM, Dinuka Silva <span dir="ltr"><<a href="mailto:dinu.kera@gmail.com" target="_blank">dinu.kera@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hello, </span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I am trying to plot annual cycle of precipitation. I could plot it but I have space after December. how can I remove that space? </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div><span style="font-size:12.8px">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"</span></div><div><span style="font-size:12.8px">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"</span></div><div><span style="font-size:12.8px">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"</span></div><div><span style="font-size:12.8px">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/diagnostics_<wbr>cam.ncl"</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">begin</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>------------------------------<wbr>-----------</span></div><div><span style="font-size:12.8px">f = "<a href="http://mon.precip.nc" target="_blank">mon.precip.nc</a>"</span></div><div><span style="font-size:12.8px">f1 = addfile(f, "r")</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">time = f1->time</span></div><div><span style="font-size:12.8px">ymd = cd_calendar(time,2)</span></div><div><span style="font-size:12.8px">iTime = ind (<a href="http://ymd.ge.19790101.and.ymd.lt">ymd.ge.19790101.and.ymd.lt</a>.<wbr>20130101)</span></div><div><span style="font-size:12.8px">precip = f1->precip (iTime,{0:-12},{90:130})</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Avg = dim_avg_Wrap(dim_avg_Wrap( precip(time|:,lat|:,lon|:)))</span></div><div><span style="font-size:12.8px">index = abs(Avg)</span></div><div><span style="font-size:12.8px">index!0 = "time"</span></div><div><span style="font-size:12.8px">index&time = Avg&time</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>------------------------------<wbr>-</span></div><div><span style="font-size:12.8px">T = index&time</span></div><div><span style="font-size:12.8px">YMD = cd_calendar(T,0)</span></div><div><span style="font-size:12.8px">imont = tointeger(YMD(:,1))</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>------------------------------<wbr>------------</span></div><div><span style="font-size:12.8px">k= new((/12/),float)</span></div><div><span style="font-size:12.8px">do mo = 0,11</span></div><div><span style="font-size:12.8px">mo1=mo+1</span></div><div><span style="font-size:12.8px">Nmont = ind(imont.eq.mo1)</span></div><div><span style="font-size:12.8px">k(mo) = dim_avg_Wrap(index(time|Nmont)<wbr>)</span></div><div><span style="font-size:12.8px">end do</span></div><div><span style="font-size:12.8px">;printVarSummary(k)</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>------------------------------<wbr>----------</span></div><div><span style="font-size:12.8px">x = new((/12/),float)</span></div><div><span style="font-size:12.8px">x = (/00.,01.,02.,03.,04.,05.,06.,<wbr>07.,08.,09.,10.,11./)</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>------------------------------<wbr>---</span></div><div><span style="font-size:12.8px">res2 = True</span></div><div><span style="font-size:12.8px">res2@tiMainString = "Monthly precipitation"</span></div><div><span style="font-size:12.8px">res2@tiXAxisString = "months"</span></div><div><span style="font-size:12.8px">res2@tiYAxisString = "precipitation (mm/month)"</span></div><div><span style="font-size:12.8px">res2@xyLineColors = "blue"</span></div><div><span style="font-size:12.8px">res2@xyLineThicknessF = 5.0</span></div><div><span style="font-size:12.8px">res2@tmXBMode = "Explicit"</span></div><div><span style="font-size:12.8px">res2@tmXBValues = x</span></div><div><span style="font-size:12.8px">res2@tmXBLabels = (/"J","F","M","A","M","J","J",<wbr>"A","S","O","N","D"/)</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>------------------------------<wbr>----------</span></div><div><span style="font-size:12.8px">wks = gsn_open_wks("x11","")</span></div><div><span style="font-size:12.8px">plot = gsn_xy(wks,x,k,res2)</span></div><div><span style="font-size:12.8px">end</span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px"><br></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><img src="cid:ii_1618d949631d4155" alt="Inline image 1" width="400" height="403"><br></div>
<br><div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px">Thank you.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px"><span class="m_16324849258779916gmail-gr_ m_16324849258779916gmail-gr_206 m_16324849258779916gmail-gr-alert m_16324849258779916gmail-gr_spell m_16324849258779916gmail-gr_inline_cards m_16324849258779916gmail-gr_run_anim m_16324849258779916gmail-ContextualSpelling m_16324849258779916gmail-ins-del m_16324849258779916gmail-multiReplace m_16324849258779916gmail-gr-progress m_16324849258779916gmail-sel" id="m_16324849258779916gmail-206" style="display:inline;border-bottom:2px solid transparent;background-repeat:no-repeat;color:inherit;font-size:inherit">Sincerly</span>,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px"><span style="font-size:12.8px">Dinuka</span></div>
<br></div></div><div id="m_16324849258779916DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
<tbody><tr>
<td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width:46px;height:29px"></a></td>
<td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" style="color:#4453ea" target="_blank">www.avast.com</a>
</td>
</tr>
</tbody></table><a href="#m_16324849258779916_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></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>