Time-Series problem [message #2118] |
Tue, 31 May 1994 05:36  |
esc
Messages: 2 Registered: May 1994
|
Junior Member |
|
|
OK, I'm running a time-series program
e.g.
----------------------------------------------
Pro test
X=[1,2,3,6,7,8,12,13,14]
Y=[2.3,2.7,3.6,3.2,3.05,3.24,3.132,2.1,3.4]
plot,X,Y
end
------------------------------------------------
Ideally I would like three seperate lines so
as to make clear the missing values at X=4,5,9,10,11.
I know I can use "oplot" in the example above
i.e.
X1=[1,2,3]
Y1=[2.3,2.7,3.6]
plot,X1,Y1
oplot...........
olpot............
but my time-series is much bigger than this.
I also don't want to use the "psym= n" keyword.
I'D LIKE CONTINOUS LINES JOINING ADJACENT POINTS
AND GAPS IN BETWEEN.
Any ideas would be much appreciated
Ewan
|
|
|
Re: Time-Series problem [message #2196 is a reply to message #2118] |
Tue, 31 May 1994 20:08  |
Jackel
Messages: 30 Registered: April 1993
|
Member |
|
|
There've already been a couple of responses to this post:
> From: esc@met.ed.ac.uk (E Carr)
> Subject: Time-Series problem
> Date: Tue, 31 May 1994 12:36:29 GMT
>
> OK, I'm running a time-series program
>
> <text deleted>
>
> Ideally I would like three seperate lines so
> as to make clear the missing values at X=4,5,9,10,11.
> I know I can use "oplot" in the example above
>
> i.e.
> X1=[1,2,3]
> Y1=[2.3,2.7,3.6]
>
> plot,X1,Y1
> oplot...........
> olpot............
>
>
> but my time-series is much bigger than this.
> I also don't want to use the "psym= n" keyword.
> I'D LIKE CONTINOUS LINES JOINING ADJACENT POINTS
> AND GAPS IN BETWEEN.
>
> Any ideas would be much appreciated
>
> Ewan
============================================================ =======================
But here goes another one. The basic idea is to use the COLOR keyword
for PLOTS, to draw "missing" lines in black. This will obviously be
a problem when drawing on top of an existing graph. Sample IDL code follows:
;----------------------------------------------------------- -------------------
-;Make some "data" arrays, with some gaps in the x's. Note that
; the first and last points are isolated, just to test the algorithm.
;
x=[0,2,3,4,5,6,7,8,9,12,13,14,15,17]
y= RANDOMN(seed,14)
;Create the plotting area. Don't draw symbols now, as
; they may get overwritten by a black (invisible) line.
;
plot,x,y,/NODATA
;For X values separated by one stepsize (1 in this case),
; the following logical statement will be true (1). Larger
; steps will be false. Note that the first element of color
; will be junk, but that's okay, as the PLOTS command doesn't use it.
;
stepsize= 1
color= (x - shift(x,1)) EQ stepsize
;Use the COLOR keyword to PLOTS. This will work for background=0,
; drawing color=255. Modify as necessary.
;
plots,x,y,COLOR=color*255
plots,x,y,PSYM=4
END
;----------------------------------------------------------- -------------------
Of course, I'd be interested in seeing other solutions.
Brian Jackel
University of Western Ontario
|
|
|