<div dir="ltr"><div><div><div><div>Hi Rick,<br><br></div>Sorry for sending two mails for one issue. I wanted to inform you that the model data file has <br>   Time coordinate :  12 steps<br>   RefTime =  1959-12-01 00:00:00  Units = days  Calendar = 360_day<br><br>  2006-12-30 12:00:00  2007-01-30 12:00:00  2007-02-30 12:00:00  2007-03-30 12:00:00<br>  2007-04-30 12:00:00  2007-05-30 12:00:00  2007-06-30 12:00:00  2007-07-30 12:00:00<br>  2007-08-30 12:00:00  2007-09-30 12:00:00  2007-10-30 12:00:00  2007-11-30 12:00:00<br><br></div> Also, I want to plot the values on the 15th of the each month instead of 30th. Please help me to do this change.<br><br></div>Best regards,<br></div>Ruksana<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 27, 2015 at 12:07 PM, Ruksana Abedin <span dir="ltr">&lt;<a href="mailto:ruksana.abedin@gmail.com" target="_blank">ruksana.abedin@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 dir="ltr"><div><div><div><div>Hi Rick,<br><br></div>Thank you for your suggestion. Yes, you are right, labels had only two values <br><br>Variable: labels<br>Type: string<br>Total Size: 16 bytes<br>                  2 values<br>Number of Dimensions: 1<br>Dimensions and sizes:   [2]<br>Coordinates:<br>(0)     12<br>(1)     01<br><br></div>I have fixed this and now the x-axis shows 1-12 for the months. Thank you so much for your help. <br>Can I change this to Jan, Feb... Dec using ncl? Any suggestion will be highly appreciated. <br><br></div>With many thanks and regards,<br></div>Ruksana <br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 5:37 PM, Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>I&#39;m not certain, and don&#39;t have a good way to test at the moment. However, a hint might be the variable &quot;incr = 1&quot;</div><div><br></div>Maybe print out the variable &quot;labels&quot; ... I&#39; guess that it only contains two values. Likewise for for PPT_obs&amp;time(:,1).<div><br></div><div>Hope that helps, but please write back to the list if not.</div><span><font color="#888888"><div><br></div></font></span><div><span><font color="#888888">Rick</font></span><div><div><br><div><br>On Wednesday, November 25, 2015, Ruksana Abedin &lt;<a href="mailto:ruksana.abedin@gmail.com" target="_blank">ruksana.abedin@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi.<br><br></div>Can you please help me to find out why I could not plot the time axis properly?<br><br></div>Below given the script anf the ouput. The axis should show 2-10 but only showing 2-3. How can I change this to Feb-Nov?<br><br></div>Thank you for your kind support.<br><div><div><div><div><br></div><div>Best regards,<br></div><div>Ruksana<br></div><div><br><br>;*****************************************************<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl&quot;<br>;*****************************************************<br>begin<br>;***************************************************** <br>;read in data <br>;***************************************************** <br>f0=addfile (&quot;/ouce-home/students/rege1218/WAH2_SAS_Results_1985_2011/<a href="http://wah2_sas_1985_2007.part.Bdesh.ymonmean.nc" target="_blank">wah2_sas_1985_2007.part.Bdesh.ymonmean.nc</a>&quot;, &quot;r&quot;);    <br>f = addfile(&quot;/ouce-home/students/rege1218/Observations/APHRO_Asian_Monsoon_1963-2007/APHRO_Bdesh_ppt_1985_2007_ymonmean.nc&quot;, &quot;r&quot;)<br>;***************************************************** <br>; parameters<br>;***************************************************** <br> <br>PPT_mod = f0-&gt;field90(:,0,0,0)<br>PPT_mod = PPT_mod*86400<br><br>PPT_obs = f-&gt;precip<br>time = f-&gt;time<br>x = PPT_obs&amp;time<br>timax = dimsizes(time)-1<br><br>fldmean = wgt_areaave_Wrap(PPT_obs,1.0,1.0,1)<br><br>;--convert the time proleptic_gregorian calendar to UTC date <br>utc_date   = cd_calendar(time,0)<br><br>;-- set date variable names<br><br>year     = tointeger(utc_date(:,0))<br>month     = tointeger(utc_date(:,1))<br>day     = tointeger(utc_date(:,2))<br>hour      = tointeger(utc_date(:,3))<br>minute      = tointeger(utc_date(:,4))<br>second      = utc_date(:,5)<br><br>;-- write date as string (MM)<br>date_str_i = sprinti(&quot;%0.2i&quot;,month)<br><br>;-- create the time strings, plot every axis annotation<br>incr     = 1<br>labels      = (/date_str_i(0:incr)/)<br><br>;-- set t resources <br>res = True<br>res@trXMinF           = time(0)     ; time minimum on axis <br>res@trXMaxF           = time(timax)     ; time maximum on axis <br>res@tmXBMode         = &quot;Explicit&quot;           ; explicit time setting<br>res@tmXBValues         = PPT_obs&amp;time(:incr)          ; axis tick position<br>res@tmXBLabels         = labels <br><br><br>colors = (/&quot;blue&quot;,&quot;violet&quot;/)<br>labels = (/&quot;RCM_ppt&quot;,&quot;OBS_ppt&quot;/)<br><br>wks = gsn_open_wks(&quot;eps&quot;,&quot;annpptcycle&quot;)  <br><br>res =True<br>res@gsnDraw    = False<br>res@gsnFrame   = False<br>res@gsnPaperOrientation = &quot;portrait&quot;<br><br>res= True   ; plot mods desired<br>res =True<br>res@gsnMaximize= True<br>res@gsnDraw    = False<br>res@gsnFrame   = False<br>res@gsnPaperOrientation = &quot;portrait&quot;<br><br><br>res= True   ; plot mods desired<br>res@tiMainString = &quot;Bangladesh with Larger Region&quot;<br>res@tiYAxisString   = &quot;mm/day&quot; <br>res@xyLineThicknessF = (/3,3/)<br>res@trYMinF                 = 0.0<br>res@trYMaxF                 = 20.0<br><br><br>res@xyLineColor          = colors(0)<br>plot0 = gsn_csm_xy(wks,x,PPT_mod,res)      <br>     <br>res@xyLineColor          = colors(1)<br>plot1 = gsn_csm_xy(wks,x,fldmean,res)      <br>     <br>overlay(plot0,plot1)<br><br><br>; Attach a legend<br><br>lgres = True<br>lgres@lgLineColors              = colors<br>lgres@lgItemType        = &quot;Lines&quot;<br>lgres@lgLabelFontHeightF     = 0.2<br>lgres@lgBoxMinorExtentF      = 0.2<br>lgres@vpWidthF            = 0.2<br>lgres@vpHeightF         = 0.2<br>lgres@pmLegendDisplayMode     = &quot;Always&quot;<br>lgres@pmLegendWidthF          = 0.05<br>lgres@pmLegendHeightF          = 0.04<br>lgres@xyExplicitLabels         = labels<br>lgres@lgBoxMinorExtentF     = 0.3<br>legend = gsn_create_legend(wks, 2, labels, lgres)<br><br>amres                 = True <br>amres@amJust             = &quot;BottomRight&quot;     ; Use bottom right corner of box for determining its location.<br>amres@amOrthogonalPosF        = -0.22<br>amres@amParallelPosF         = 0.4<br><br>annoid  =  gsn_add_annotation(plot0, legend, amres)  ; add legend to plot <br><br>draw(plot0)<br><br>frame(wks)<br><br>end<br></div></div></div></div></div>
</blockquote></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>