Re: x axis Major Tick Marks

From: Yi-Chih Huang <dscpln_at_nyahnyahspammersnyahnyah>
Date: Tue Nov 12 2013 - 19:06:57 MST

Hello,

    I got the tick marks and labeling on x axis. I found that the commands
in my script have to set res@tmXBMode = "Manual", but
"warning:ManualComputeMajorTickMarks: The precision specified is smaller
than the precision needed tick mark labels may not be correct" still showed
up though tmXBLabels and tmXBTickStartF are consistent. I am not sure what
the warning means. Tingting's commands can be used in res@tmXBMode =
"Manual" or "Explicit" without any warning. But, I only need years on x
axis.

########## my version
  res@tmXBMode = "Manual"
  res@tmXBValues = ispan(1,36,1) ;1986-1988, 3yrs, 36mos
  res@tmXBLabels = mth
  res@tmXBTickStartF = 1986
  res@tmXBTickEndF = 1989
  res@tmXBTickSpacingF= 1
  res@tmXBPrecision = 4

########## Tingting's version
  yyyymm = yyyymm_time(1996, 1998, "integer")
  yrfrac = yyyymm_to_yyyyfrac(yyyymm, 0.0)
  res@trXMinF = 1986
  res@trXMaxF = 1989
  res@tmXBMode = "Explicit"
  res@tmXBValues = yrfrac
  res@tmXBLabels = ""+yyyymm

  res@tmXBLabelAngleF = 60
  res@tmXBLabelFontHeightF = 0.008

    Best,

           Yi-Chih

On Wed, Nov 13, 2013 at 2:03 AM, Tingting Fan <tingting@ucar.edu> wrote:

> Hi Yi-Chih,
> I did a simple exercise, which worked fine for me.
> So, I guess the problem 'no tick mark on x axis' could because no
> resources for 'trXMinF' and 'trXMaxF'.
> Maybe you can try, as follow:
> ....
> yyyymm = yyyymm_time(1986, 1988, "integer")
> yrfrac = yyyymm_to_yyyyfrac(yyyymm, 0.0)
> ....
> res@trXMinF = 1986
> res@trXMaxF = 1989
> ....
> res@tmXBMode = "Explicit"
> res@tmXBValues = yrfrac
> res@tmXBLabels = ""+yyyymm
>
> res@tmXBLabelAngleF = 60
> res@tmXBLabelFontHeightF = 0.008
>
> plot = gsn_csm_xy (wks,yrfrac,X,res)
> ..........
> Hope it helps...
> Tingting
>
> > Hello Tingting,
> >
> > Thanks much for the proposed commands. But yet there is no tick mark
> > or labeling on x axis though warnings disappeared after I tried several
> > times.
> >
> > Best,
> >
> > Yi-Chih
> >
> >
> > On Tue, Nov 12, 2013 at 4:10 AM, Tingting Fan <tingting@ucar.edu> wrote:
> >
> >> Hi Yi-Chih,
> >> Maybe you would like to try these, as follow:
> >> -----
> >> mth=
> >>
> >>
> (/198601,198602,198603,198604,198605,198606,198607,198608,198609,198610,198611,198612,\
> >>
> >>
> 198701,198702,198703,198704,198705,198706,198707,198708,198709,198710,198711,198712,\
> >>
> >>
> 198801,198802,198803,198804,198805,198806,198807,198808,198809,198810,198811,198812/)
> >> ...
> >> ...
> >> res@tmXBMode = "Explicit"
> >> res@tmXBValues = ispan(1,36,1) ;1986-1988, 3yrs, 36mos
> >> res@tmXBLabels = mth
> >> ------
> >> Hope it helps!
> >> Tingting
> >>
> >> --
> >> Tingting Fan
> >> grad student visitor
> >> NCAR/CGD/CAS
> >> tel:303-497-1745
> >>
> >>
> >
>
>
> --
> Tingting Fan
> grad student visitor
> NCAR/CGD/CAS
> tel:303-497-1745
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Nov 12 19:07:09 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST