[ncl-talk] minor tickmarks in date/time style plot
ivica
ivica.jan at gmail.com
Fri Jan 23 04:49:37 MST 2015
Got it with some additional effort.
If someone needs this is how I did it:
utc_date = cd_calendar(time, 0)
year = tointeger(utc_date(:,0))
month = tointeger(utc_date(:,1))
day = tointeger(utc_date(:,2))
start_month=ind(day.eq.1);
start_year =ind(month.eq.1 .and. day.eq.1)
tmp = dimsizes(start_year)
nyears = tmp(0)
res at tmXBTickStartF = start_year(0)
res at tmXBTickEndF = start_year(nyears-1)
res at tmXBMode = "Explicit"
res at tmXBValues = time(start_year)
res at tmXBLabels = year(start_year)
res at tmXBMinorValues = time(start_month)
Ivica
On 01/23/2015 12:03 PM, ivica wrote:
> Dear ncl community,
> I am plotting regular XY plot with X coordinate as time (date).
> Feature of time_axis_labels works as expected, the only problem I have
> is to put minor ticks at the beginning of the month.
> For example, you have daily data of temperature for 5 years and you want
> to put on X axis years as mayor ticks with corresponding tick labels
> but at the same time minor ticks for start of each month.
> Using resTick at ttmMajorStride = 365.25 (for approx year) and
> resTick at ttmMinorStride = 30 (for monthly) is not working as Feb is 28
> days and so on...
>
> Any hint is welcome.
>
> Cheers,
> Ivica
>
>
>
--
Marine & Environmental Research Division
Rudjer Boskovic Institute
P.O.Box 180
10002 Zagreb, Croatia
http://www.irb.hr/eng/People/Ivica-Janekovic
fax: +385-1-468 0242, phone: +385-1-456 1139
More information about the ncl-talk
mailing list