Hi,
Can somebody tell me why 2009 and 2011 isn't visible? What is missing
in the code?
Cheers,
Sebastian
function myticks, axis, index, value, level
if n_elements(level) eq 0 then level = 0
case level of
0: begin ; months
return, string(value, FORMAT='(C(CMOA))')
end
1: begin ; years
return, string(value, FORMAT='(C(CYI))')
end
endcase
end
pro ts_plot
begin_date=julday(9,1,2009,0,0,0)
end_date=julday(4,1,2011,0,0,0)
min_y=0
max_y=100
symsize=0.1
charsize=1.4
ythick = 1
xthick = 1
linethick = 1
xmargin=[8,8]
ymargin=[8,8]
dummy = label_date(DATE_FORMAT=['%M','%Y'], $
MONTHS=['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP ','OCT','NOV','DEC'])
xtv = timegen(20, UNITS="Months", START=begin_date)
window, /FREE, xsize=1200, ysize=400, xpos=100, ypos=100
plot, [ begin_date, end_date], [0., 100.], $
/NODATA, YTICKLEN=1, YGRIDSTYLE=1, $
YTHICK=ythick, XTHICK=xthick, $
POSITION=[0.1,0.25,0.9,0.85], $
YSTYLE=1, XSTYLE=1, $
YTICKS=5, $
COLOR=cgColor('black'), $
XTICKLEN = 0.005, $
XTICKS = n_elements(xtv)-1, $
XTICKV = xtv, $
XTICKFORMAT = 'MYTICKS', $
XTITLE='', YTITLE='Soil Moisture (%)', $
TITLE=title, $
XTICKUNITS = ['Months','Years'], $
XTICKLAYOUT = 2, $
BACKGROUND = cgColor('white'), $
CHARSIZE=charsize
for i=0, n_elements(xtv)-1 do begin
oplot, [xtv[i], xtv[i]], [0.,100.], COLOR=cgColor('black'),
THICK=0.5, LINESTYLE=1
endfor
end
|