comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Plotting with colorbar
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Plotting with colorbar [message #87237 is a reply to message #87225] Sun, 19 January 2014 11:18 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
fischertc13@gmail.com writes:

>
>>
>> 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!

I'm just about to get on a plane, so I can elaborate, but I would update
your Coyote Library (it is about 5 years out of date) and then
investigate the transparency keywords available in cgImage. This will be
simple to do. You can find entire articles written about it on my web
page. :-)

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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Maps - ellipsoids in map_set ('scale on the central meridian')
Next Topic: averaging w.r.t time resolution

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:18:17 PDT 2025

Total time taken to generate the page: 0.00273 seconds