Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: IDL plottin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 5696 of 5741
Post > Topic >>

Re: IDL plotting query - how can I get rid of unwanted colour for a particular data value???

by David Fanning <news@[EMAIL PROTECTED] > May 1, 2008 at 11:20 AM

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.")




 3 Posts in Topic:
IDL plotting query - how can I get rid of unwanted colour for a
edhanna2008@[EMAIL PROTEC  2008-05-01 09:51:44 
Re: IDL plotting query - how can I get rid of unwanted colour fo
Vince Hradil <hradilv@  2008-05-01 09:57:29 
Re: IDL plotting query - how can I get rid of unwanted colour fo
David Fanning <news@[E  2008-05-01 11:20:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 3:19:32 CDT 2008.