Re: Error using time_axis_labels

From: Arindam Chakraborty <arch13_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 11 2014 - 04:10:40 MDT

Hi Juki Juki,
 you need not mention all the 100 points there. You need to mention only
those time values where you want tick marks. I guess, that cannot be more
than 7 to 8.

regards,

--
*Dr Arindam Chakraborty*
CAOS, IISc, Bangalore-12
On Tue, Mar 11, 2014 at 1:29 PM, juki juki <juky_emc2@yahoo.com> wrote:
> Dear Arindam;
>
> Thank you for reply. I got the following warning while running:
>
> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
> approximation for Y axis failed: consider adjusting trYTensionF value
> warning:IrTransInitialize: error creating spline approximation for
> trYCoordPoints; defaulting to linear
>
> I will take time if I define the tick as:
>
> resTick@ttmValues = (/(/2008,01,01,00,00,00/), ; please make sure you
> change these dates according to your axis
>                                            (/2008,01,02,00,00,00/),
>                                            (/2008,01,03,00,00,00/)
>                                          /)
> Because the data line is more than hundred.
>
> I send the result as the attached file. Thank you again.
>
> Juki
>
>
>   On Tuesday, March 11, 2014 1:30 PM, Arindam Chakraborty <
> arch13@gmail.com> wrote:
>   Hi Juki Juki,
>  not appearance of tick marks could be due to more than one reasons. Do
> you have sufficient space between the axis and the left most margin of the
> plot area? You can also try using ttmValues to tick at the locations you
> want exactly. For example:
>
>   resTick                = True
>   resTick@ttmFormat      = "%d %c"
>   resTick@ttmAxis        = "YL"
>   resTick@ttmValues = (/(/2008,01,01,00,00,00/), ; please make sure you
> change these dates according to your axis
>                                            (/2008,01,02,00,00,00/),
>                                            (/2008,01,03,00,00,00/)
>                                          /)
>
>   time_axis_labels(data&time, res, resTick )
> ...
>
>
> About your 2nd question, please see how to format tick marks, in ncl
> resources documentation. You might use tmXBFormat here.
>
>
> regards,
> --
> *Dr Arindam Chakraborty*
> CAOS, IISc, Bangalore-12
>
>
> On Tue, Mar 11, 2014 at 10:55 AM, juki juki <juky_emc2@yahoo.com> wrote:
>
> Dear All;
>
> I try to visualize my data to longitude versus time plot (code is given
> below). I use simple command as time_axis_labels(data&time, res, resTick ).
> However, the tick for the y axis (time) does not appear. Another question,
> the longitude (X-axis) is very narrow area (100.225 - 100.475 E). How to
> make the tick mark visible for such narrow longitude ?
>
> Thanks for help
> joeky
>
>
>
> ------------------------
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load
> "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl" load
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" begin ; read in data
> ncols = 9 ; nrows = 596 ; data1 = asciiread ("CPEA2004_Ayu_230.txt",
> (/nrows,ncols/), "float") ; For data yyyy =
> floattointeger(data1(:,0)+2000); mm = floattointeger(data1(:,1)); dd =
> floattointeger(data1(:,2)); hh = floattointeger(data1(:,3)); mn =
> floattointeger(fspan(0, 0, 596)) sd = floattointeger(fspan(0, 0, 596))
> data=data1(:,4:8) if (any(isnan_ieee(data))) then value = 1.e20
> replace_ieeenan (data, value, 0) data@_FillValue = value end if
> time=new(dimsizes(yyyy),double) time@units = "days since 1800-01-01
> 00:00:00" do i=0,dimsizes(yyyy)-1 time(i)=cd_inv_calendar(yyyy(i),
> mm(i),dd(i),hh(i),mn(i),sd(i),time@units, 0) end do lon =
> fspan(100.225,100.475, ncols-4) lon!0 = "lon" lon@units = "degrees_east"
> data!0 = "time" data!1 = "lon" data&time = time data&lon = lon
> data@long_name = "(a) Tb < 230 K" data@units = "K" wks = gsn_open_wks
> ("png", "hovTBB" ) ; open ps file gsn_define_colormap(wks, "cosam") ;
> choose colormap gsn_reverse_colormap(wks) setvalues
> NhlGetWorkspaceObjectId() "wsMaximumSize" : 600000000 end setvalues res =
> True ; plot mods desired res@cnFillOn = True ; turn on color fill ;
> res@gsnSpreadColors = False ; use full range of colors res@cnLinesOn =
> False res@vpWidthF = 0.2 res@vpHeightF = 0.4 res@trYReverse = True ;
> res@tiMainString = "WESTWARD" ; title res@cnLevelSelectionMode =
> "ManualLevels" ; manual contour levels res@cnMinLevelValF = 140. ; min
> level res@cnMaxLevelValF = 230 ; max level ; res@cnLevelSpacingF = 10 ;
> contour level spacing res@pmLabelBarWidthF = 0.05 res@pmLabelBarHeightF =
> 0.4 res@lbOrientation = "Vertical" res@pmLabelBarOrthogonalPosF = -0.03 ;
> move label bar closer res@lbLabelStride = 1 ; res@mpMinLonF = 80. ;
> res@mpMaxLonF = 130. res@txFontHeightF = 0.02 ; resize the text ;
> res@lbLabelFontHeightF = 0.02 ; res@gsnMajorLonSpacing = 10 ;
> res@gsnSpreadColorStart = -1 ; start with last color ;
> res@gsnSpreadColorEnd = 2 ; end with a beginning color
> res@gsnStringFontHeightF = 0.015 ; now change the size of the tickmark
> labels res@tmXBLabelFontHeightF = 0.015 ; resize tick labels
> res@tmYLLabelFontHeightF = 0.015 res@lbLabelFontHeightF = 0.015
> res@gsnLeftString = "Tb < 230 K" res@gsnRightString = "K"
> res@gsnRightStringParallelPosF=1.15 resTick = True resTick@ttmFormat =
> "%d %c" resTick@ttmAxis = "YL" resTick@ttmMajorStride = 48
> time_axis_labels(data&time, res, resTick ) plot = gsn_csm_hov(wks, data,
> res) end
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 11 04:11:12 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT