Re: Skipping plot discontinuities. [message #572] |
Mon, 05 October 1992 04:20 |
zawodny
Messages: 121 Registered: August 1992
|
Senior Member |
|
|
Awhile back, PLOTS had an extra argument (pen, I think) which was a vector of
one's and zero's. When an entry was a zero the PLOTS command would "lift the
pen" until a non-zero value was encountered. This highly desirable feature is
now gone! I went through a program of mine which does what you are looking for
and extracted some code which does the segment isolation and plotting. It also
does a POLYFILL so it probably is more complicated than need be but, you can
hack it down to the bare necessities.
; for the purposes here plot segments are separated by points where t(i) = 0
; Locate segments
t = [0.,timave,0.]
; find the segment starting end
m = where(t eq 0.)
n = where((shift(m,-1)-m) gt 1,nms)
ms = m(n)+1
; find the segment finishing end
m = where(t ne 0.)
n = where((shift(m,-1)-m) gt 1,nme)
me = m(n)
; for all segments
for i=0,nme-1 do begin
; the reverse here is for polyfill and drawing a "box" around the hatched area
x = [ t(ms(i):me(i)-1 ), reverse(t(ms(i):me(i)-1 ))]
y = [hi(ms(i):me(i)-1,k),reverse(lo(ms(i):me(i)-1,k))]
oplot,x,y
polyfill,x,y,orient=45.
endfor
It may not be pretty but it does work!
Good Luck
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- *-*-*-*-*-*-*-*-*-*
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
zawodny@arbd0.larc.nasa.gov MS-475, Hampton VA, 23681
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- *-*-*-*-*-*-*-*-*-*
|
|
|