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

Home » Public Forums » archive » Re: IDL plotting query - how can I get rid of unwanted colour for a particular data value???
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: IDL plotting query - how can I get rid of unwanted colour for a particular data value??? [message #60095] Thu, 01 May 2008 10:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vince Hradil writes:

> a clever use if "where()" comes to mind...

Well, with an intelligent use of BYTSCL, too. :-)

Image pixels, no matter what they are *have*
to be displayed. No getting around it.

If you don't what certain pixels to "mean" anything,
then what is typically done is to assign those
pixels the same value as the background color.

This assumes you know how to reserve certain colors
for the image and certain colors for the background.
Something like this should work:

Window, XSIZE=400, YSIZE=400
Loadct, 13, NCOLORS=250
TVLCT, 255, 255, 255, 251 ; White background color.
TVLCT, 0, 0, 0, 252 ; Black drawing color.
image = dist(400)
image [10:50, 300:350] = -999
badpixels = Where(image EQ -999)
Device, Decomposed=0, Get_Decomposed=theState
Erase, COLOR=251
pos = [0.1, 0.1, 0.9, 0.75]
scaled = BytScl(image, TOP=249, MIN=0, MAX=max(image))
scaled[badpixels] = 251
TVImage, scaled, Position=pos, /KEEP_ASPECT
Colorbar, NCOLORS=250, AnnotateColor='black', $
Position=[0.1, 0.85, 0.9, 0.9]
Device, decomposed=theState
END

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: IDL plotting query - how can I get rid of unwanted colour for a particular data value???
Next Topic: HDF_SD_ADDDATA problem

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

Current Time: Fri Oct 10 09:38:18 PDT 2025

Total time taken to generate the page: 0.47868 seconds