<div dir="ltr"><div class="gmail_default" style="font-size:small">The time_axis_labels sets some tmXXXX resources for you under the hood, and you can add more tm resources as desired.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try setting the tmXBLabelFontHeightF resource to make the font height smaller for the X axis labels.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try something small, like 0.008:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div style="font-size:12.8px">   time_axis_labels(newtime, <wbr>res, resxt) <br>  res@tmXBLabelFontHeightF = 0.008</div><div style="font-size:12.8px"><br></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 8:22 PM, <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>thanks, according to the link and your code, i made the following plot</div><div><br></div><div><div>   resxt= True<br>   resxt@ttmFormat  = &quot;%c&quot;<br>   ;resxt@ttmMajorStride = 3<br>   resxt@ttmNumTicks =  10<br>   time_axis_labels(newtime, <wbr>res, resxt) </div></div><div><br></div><div>but i cannot find the attribute about font size with prefix &quot;ttm&quot;, if i set <span style="font-size:10.5pt;line-height:1.5;background-color:window">ttmNumTicks more than 10 or others , the x-axis appearance will be overlaid each other.</span></div><div><br></div><div>thanks</div><div><div>
<img src="cid:_Foxmail.1@943c50ef-4a29-52f3-6267-c96c860e4674"></div></div>
<div><br></div><hr style="width:210px;min-height:1px" color="#b5c4df" size="1" align="left">
<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>
<blockquote style="margin-top:0px;margin-bottom:0px;margin-left:0.5em"><div> </div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT:8px;PADDING-LEFT:8px;FONT-SIZE:12px;FONT-FAMILY:tahoma;COLOR:#000000;BACKGROUND:#efefef;PADDING-BOTTOM:8px;PADDING-TOP:8px"><div><b>From:</b> <a href="mailto:haley@ucar.edu" target="_blank">Mary Haley</a></div><div><b>Date:</b> 2016-08-23 23:39</div><div><b>To:</b> <a href="mailto:dyjbean@gmail.com" target="_blank">dyjbean@gmail.com</a></div><div><b>CC:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk</a></div><div><b>Subject:</b> Re: [ncl-talk] about irregular time with gsn_csm_lat_time</div></div></div><div><div class="h5"><div><div><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The problem is that you are trying to use rather erratically spaced values on the X axis.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you think about the &quot;time&quot; values as just regular numbers, this means when you go from time=201111, 201112, 201201, 201202, you are going from an increment of 1, to an increment of 89, and then back to an increment of 1. This is what causes NCL to give you the &quot;spline&quot; error.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To fix this, you need to convert your YYYYMM time values into numeric values with more reasonable spacing. This can be done using cd_inv_calendar:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>cd_inv_calendar.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">You can then use the very nice user contributed &quot;time_axis_labels&quot; routine:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/User_<wbr>contributed/time_axis_labels.<wbr>shtml</a></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">to easily format the X axis as desired,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See the attached &quot;fixtime.ncl&quot; script which uses dummy data, based on the lat/time values you provided in your script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 3:44 AM, <a href="mailto:dyjbean@gmail.com" target="_blank">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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>
<div><span></span>hi,</div><div>   when i use <span style="background-color:rgba(0,0,0,0);font-size:10.5pt;line-height:1.5">gsn_csm_lat_time, i got the following warning info:</span></div><div><span style="background-color:rgba(0,0,0,0);font-size:10.5pt;line-height:1.5">      </span><span style="font-size:10.5pt;line-height:1.5;background-color:window">warning:_NhlCreateSplineCoor<wbr>dApprox: Attempt to create <wbr>spline approximation for X <wbr>axis failed: consider <wbr>adjusting trXTensionF value</span></div><div>     warning:IrTransInitialize: er<wbr>ror creating spline approximat<wbr>ion for trXCoordPoints; <wbr>defaulting to linear </div>
<div> and the x-axis didn&#39;t appear.</div><div><br></div><div>the below is my script:</div><div>  </div><div><div> load &quot;$NCARG_ROOT/lib/ncarg/n<wbr>clscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nc<wbr>lscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nc<wbr>lscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nc<wbr>lscripts/csm/shea_util.ncl&quot;<br><br>begin<br><br>    minlat = 9<br>    maxlat = 56<br>    minlon = 70<br>    maxlon = 150<br><br><br>files10=systemfunc(&quot;cat  nccol<wbr>umn.log&quot;)<br>print(files10)<br><br>setfileoption(&quot;nc&quot;,&quot;Format&quot;,&quot;L<wbr>argeFile&quot;)<br>mons01ff=addfiles(files10,&quot;r&quot;)<br>ListSetType(mons01ff,&quot;join&quot;)<br><br><br>slat10=mons01ff[:]-&gt;lat<br>slon10=mons01ff[:]-&gt;lon<br>colm10=mons01ff[:]-&gt;column_ozo<wbr>ne<br>colm10dms=dimsizes(colm10)<br>colm10@_FillValue=999.0<br>colm10=colm10*0.1<br><br>pcolm10=colm10(:,{minlon:maxlo<wbr>n},{minlat:maxlat})<br><br><br>tlat10=slat10(0,{minlat:maxlat<wbr>})<br>tlon10=slon10(0,{minlon:maxlon<wbr>})<br><br><br>tlat10@units=&quot;degrees-north&quot;<br>tlon10@units=&quot;degrees-east&quot;<br><br><br><br>acolm10=dim_avg_n(pcolm10,1)<br>;print(&quot;----&quot;+dimsizes(acolm10<wbr>))<br><br>times10=yyyymm_time(2010,2012,<wbr>&quot;integer&quot;)<br>;times10=yyyymm_to_yyyyfrac(it<wbr>imes10, 0.0)<br>times10!0 = &quot;time&quot;<br>times10@units=&quot;Months since Ja<wbr>nuary 2010&quot;<br>times10@long_name=&quot;Months&quot;<br><br>acolm10!0=&quot;time&quot;<br>acolm10!1=&quot;lat&quot;<br>acolm10@units=colm10@units<br>acolm10@long_name=colm10@long_<wbr>name<br>acolm10&amp;time=times10<br>acolm10&amp;lat=tlat10<br>; print(times10)<br><br>printVarSummary(acolm10)<br><br>;printMinMax(acolm10&amp;lat, 0)<br>; printMinMax(tlon10, 0)<br><br>print(acolm10&amp;time)<br><br>delfile=systemfunc(&quot;rm &quot;+&quot;zona<wbr>l_column&quot;+&quot;.png&quot;)<br>wks=gsn_open_wks(&quot;png&quot;,&quot;zonal_<wbr>column&quot;)<br>gsn_define_colormap(wks,&quot;GMT_n<wbr>o_green&quot;)<br>   res  = True<br>   res@cnFillOn  =  True<br>   res@cnLinesOn =  False<br>   res@gsnAddCyclic  = False<br>   <br>   ;res@pmTickMarkDisplayMode <wbr>= &quot;Always&quot;<br>   res@tmYLMode = &quot;Explicit&quot;<br>   res@tmYLValues =(/10,15,20,<wbr>25,30,35,40,45,50,55/)<br>   res@tmYLLabels =(/&quot;10~S~o~N<wbr>~N&quot;,&quot;15~S~o~N~N&quot;,&quot;20~S~o~N~N&quot;,<wbr>&quot;25~S~o~N~N&quot;,\<br>                    &quot;30~S~o~N~<wbr>N&quot;,&quot;35~S~o~N~N&quot;,&quot;40~S~o~N~N&quot;, <wbr>\<br>                    &quot;45~S~o~N~<wbr>N&quot;,&quot;50~S~o~N~N&quot;,&quot;55~S~o~N~N&quot;/)<br>   ;res@tmXBMinorOn =  False <br>   <br>   res@tmXBMode = &quot;Explicit&quot;<br>   ;res@tmXBFormat = &quot;f&quot;<br> <font color="#ff0000">  ;res@tmXBValues =(/201001,2<wbr>01002,201003,201004,201005,201<wbr>006,\<br>   ;                  201007,2<wbr>01008,201009,201010,201011,201<wbr>012,\<br>   ;                  201101,2<wbr>01102,201103,201104,201105,201<wbr>106,\<br>   ;                  201107,2<wbr>01108,201109,201110,201111,201<wbr>112,\<br>   ;                  201201,2<wbr>01202,201203,201204,201205,201<wbr>206,\<br>   ;                  201207,2<wbr>01208,201209,201210,201211,201<wbr>212/)</font><br><br>    <br>    <font color="#0000ff">res@tmXBValues =(/201001,2<wbr>01003,201006,201009,201012,\<br>                      201101,2<wbr>01103,201006,201109,201112,\<br>                      201201,2<wbr>01203,201206,201209,201212/)</font><br><br>  <font color="#ff0000"> ;res@tmXBLabels =(/&quot;JAN&quot;,&quot;F<wbr>EB&quot;,&quot;MAR&quot;,&quot;APR&quot;,&quot;MAY&quot;,&quot;JUN&quot;,\<br>   ;                 &quot;JUL&quot;,&quot;AU<wbr>G&quot;,&quot;SEP&quot;,&quot;OCT&quot;,&quot;NOV&quot;,&quot;DEC&quot;,\<br>   ;                 &quot;JAN&quot;,&quot;FE<wbr>B&quot;,&quot;MAR&quot;,&quot;APR&quot;,&quot;MAY&quot;,&quot;JUN&quot;,\<br>   ;                 &quot;JUL&quot;,&quot;AU<wbr>G&quot;,&quot;SEP&quot;,&quot;OCT&quot;,&quot;NOV&quot;,&quot;DEC&quot;,\<br>   ;                 &quot;JAN&quot;,&quot;FE<wbr>B&quot;,&quot;MAR&quot;,&quot;APR&quot;,&quot;MAY&quot;,&quot;JUN&quot;,\<br>   ;                 &quot;JUL&quot;,&quot;AU<wbr>G&quot;,&quot;SEP&quot;,&quot;OCT&quot;,&quot;NOV&quot;,&quot;DEC&quot;/)</font><br>  <font color="#0000ff"> res@tmXBLabels =(/&quot;JAN~C~20<wbr>10&quot;,&quot;MAR~C~2010&quot;,&quot;JUN~C~2010&quot;,<wbr>&quot;SEP~C~2010&quot;,&quot;DEC~C~2010&quot;,\<br>                     &quot;JAN~C~20<wbr>11&quot;,&quot;MAR~C~2011&quot;,&quot;JUN~C~2011&quot;,<wbr>&quot;SEP~C~2011&quot;,&quot;DEC~C~2011&quot;,\<br>                     &quot;JAN~C~20<wbr>12&quot;,&quot;MAR~C~2012&quot;,&quot;JUN~C~2012&quot;,<wbr>&quot;SEP~C~2012&quot;,&quot;DEC~C~2012&quot;/)</font><br>   res@tmXBLabelFontHeightF = <wbr>0.015<br>   ;res@tmYLMinorOn = False<br>   <br>  res@tiMainString = &quot;&quot;<br><br>    plot=gsn_csm_lat_time(wks,<wbr>acolm10(lat|:,time|:),res)<br><br>end </div></div><div><br></div><div><br></div><div>the red letters is my origin destination, the blue letters is my test, but they didn&#39;t give the right plot.</div><div><br></div><div><img src="cid:_Foxmail.1@cecb5f83-2713-f1d6-645a-5a93c7556467" border="0"></div><div>the following is my running information:</div><div> <span style="font-size:10.5pt;line-height:1.5;background-color:window">Variable: acolm10</span></div><div>Type: float<br>Total Size: 6768 bytes<br>            1692 values<br>Number of Dimensions: 2<br>Dimensions and sizes:   [time <wbr>| 36] x [lat | 47]<br>Coordinates:<br>            time: [201001..201<wbr>212]<br>            lat: [9.5..55.5]<br>Number Of Attributes: 3<br>  long_name :   ozone column<br>  units :       DU<br>  _FillValue :  999<br><br><br>Variable: time (coordinate)<br>Type: integer<br>Total Size: 144 bytes<br>            36 values<br>Number of Dimensions: 1<br>Dimensions and sizes:   [time <wbr>| 36]<br>Coordinates:<br>Number Of Attributes: 2<br>  units :       Months since J<wbr>anuary 2010<br>  long_name :   Months<br>(0)     201001<br>(1)     201002<br>(2)     201003<br>(3)     201004<br>(4)     201005<br>(5)     201006<br>(6)     201007<br>(7)     201008<br>(8)     201009<br>(9)     201010<br>(10)    201011<br>(11)    201012<br>(12)    201101<br>(13)    201102<br>(14)    201103<br>(15)    201104<br>(16)    201105<br>(17)    201106<br>(18)    201107<br>(19)    201108<br>(20)    201109<br>(21)    201110<br>(22)    201111<br>(23)    201112<br>(24)    201201<br>(25)    201202<br>(26)    201203<br>(27)    201204<br>(28)    201205<br>(29)    201206<br>(30)    201207<br>(31)    201208<br>(32)    201209<br>(33)    201210<br>(34)    201211<br>(35)    201212<br>warning:_NhlCreateSplineCoordA<wbr>pprox: Attempt to create <wbr>spline approximation for X <wbr>axis failed: consider <wbr>adjusting trXTensionF value<br>warning:IrTransInitialize: err<wbr>or creating spline approximati<wbr>on for trXCoordPoints; <wbr>defaulting to linear </div><div><br></div><div><br></div><div>can you give me some advice for tuning this irregular x-axis time labels?</div><div><br></div><div>thanks</div><div><br></div><div><br></div><div><br></div><div><br></div><hr style="width:210px;min-height:1px" color="#b5c4df" size="1" align="left"><span><font color="#888888">
<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" 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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></div></div></blockquote>
</div></blockquote></div><br></div>