Re: color tables and cgcolorbar [message #83109] |
Wed, 06 February 2013 15:20 |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On 2/6/13 3:25 PM, David Fanning wrote:
> Jeremy Bailin writes:
>
>> I want to display a color bar using cgcolorbar where the first N colors
>> are taken from color table 33 and the rest are black. Does anyone have a
>> quick 2-liner?
>
> n = 36
> TVLCT, BytArr(256), BytArr(256), BytArr(256)
> cgLoadCT, 33, NColors=n
> cgColorBar
>
> Cheers,
>
> David
That's not quite what I want - I actually only want the bottom N colors
of the color table. But it put me on the right track! I added in
CLIP=[0,n-1] to the cgloadct call, and it looks good.
Thanks,
-Jeremy.
|
|
|
Re: color tables and cgcolorbar [message #83110 is a reply to message #83109] |
Wed, 06 February 2013 13:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeremy Bailin writes:
> I want to display a color bar using cgcolorbar where the first N colors
> are taken from color table 33 and the rest are black. Does anyone have a
> quick 2-liner?
n = 36
TVLCT, BytArr(256), BytArr(256), BytArr(256)
cgLoadCT, 33, NColors=n
cgColorBar
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.")
|
|
|