>
> Try this:
>
>
>
> time=LINDGEN(86400) ; in seconds
>
> tmp_data=REPMAT([-9,1,2,3,4],20,86400)
>
> data=tmp_data[0:98,*]
>
> missingIndices=WHERE(data EQ -9, missingCount)
>
> IF missingCount GT 0 THEN data[missingIndices]=0
>
> img=Byte(data)
>
> TVLCT, cgColor('WHITE',/Triple),0 ; Background color
>
> TVLCT, cgColor(['DARK RED','RED','SKY BLUE','BLUE'],/Triple),1
>
> cgimage, Transpose(data), /axes, axkeyword={xtitle:'Time'}
>
> END
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Hi all,
I have a similar question where I have populated a 2D field with velocity measurements that are assigned a rainbow of colors and want array points that do not have a value to be whited out (or preferably not shown at all). I assign all points without a velocity a NaN value, but that just ends up assigning these points the 0 value in the Rainbow color table I am using.
I can get the valueless array points to be white by instead assigning them some high velocity (i.e. 999999) in the Rainbow+White color table, but I when I try to plot the image as a postscript it instead uses the 254 value right before white which is instead red. Additionally, this puts a white bar at the top of my color bar which is a bit annoying.
Here is what I'm using right now:
i = WHERE(field EQ 0.000, count)
IF (count GT 0) THEN array1[i] = !VALUES.F_NAN
set_plot, 'ps'
!p.font=0
device, filename='vel_center.eps',bits_per_pixel=8,/portrait,/inches , $
xsize = 7.2, ysize = 6.,/encapsulated,/color,xoffset=1.0,yoffset=1.0
!p.noerase=1
loadct,39 ;rainbow
tvim,array1,range=[-300,300],POSITION=[.08,.05,.83,.95],/noa xis
fsc_contour,image,levels=levels,/overplot,color='black',labe l=0
loadct,0 ; b & w
loadct,39 ;rainbow
FSC_COLORBAR, POSITION=[0.83,0.05,0.88,0.95], Divisions=4, Minor=5, Format='(F5.0)', Range=[-300, 300],title='Velocity (km/s)',/vertical,/right
device, /close
set_plot, 'x'
loadct,0 ; b & w
Any comments are appreciated!
Cheers,
Travis
|