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 #87228 is a reply to message #87225] Fri, 17 January 2014 04:11 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
fischertc13@gmail.com writes:

> 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 would do a couple of things. First, I would update your Coyote
Library. It appears to be about five years out of date. Then I would
investigate the transparent properties of cgImage, specifically the
MISSING keyword:

http://www.idlcoyote.com/idldoc/cg/cgimage.html

What you want to do is pretty easy:

http://www.idlcoyote.com/cg_tips/transimage.php

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos 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: Sat Oct 11 12:44:31 PDT 2025

Total time taken to generate the page: 0.56216 seconds