Re: Pan/Zoom Line Plots with Coyote Graphics [message #80263 is a reply to message #80153] |
Fri, 25 May 2012 07:48   |
Mark Piper
Messages: 198 Registered: December 2009
|
Senior Member |
|
|
On Friday, May 25, 2012 3:19:03 AM UTC-6, Fab wrote:
> Bonus question: are IDL NG routines better at labeling time
> automatically? (in other words: should I go for IDL 8.2?)
Here's a start:
pro timeaxis_ex
compile_opt idl2
; Ten days of data; each sample taken at noon UTC.
time_min = julday(1,20,2012,12,0,0)
time_max = julday(1,29,2012,12,0,0)
time = timegen(start=time_min, final=time_max)
foo = randomn(1, 10)
p = plot(time, foo, 'r', $
xtickunits='days', $
xtickformat='(C(CMoA,1x,CDI))', $
title='Time Axis Example')
end
Zoom by rolling the scroll wheel. I chose 'days' as the tickunit; you may want to build logic into the window (using NG event handling) to change XTICKUNITS and XTICKFORMAT conditioned on p.xrange.
mp
|
|
|