|
Re: cgcolor load color to the current color table. [message #78135 is a reply to message #78133] |
Wed, 26 October 2011 13:31  |
Zhang Bo
Messages: 22 Registered: October 2011
|
Junior Member |
|
|
On Oct 26, 1:50 pm, David Fanning <n...@dfanning.com> wrote:
> Zhang Bo writes:
>> With decomposed color, how to show color gradient in a contour plot?
>> The we I can image is by setting an array of gradient numbers for
>> colors every time, which seems not quite convenient.
>
> I'm not sure what you are asking. cgContour works with
> color tables and color values in the normal way. It does
> ALL its drawing in decomposed color mode, if at all possible.
>
> Device, Decomposed=1
> Loadct, 5
> cgContour, cgDemoData(2), /Fill, NLEVELS=15
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Sounds like using cgcontour can make the color right instead of using
just contour under decomposed color.
Thanks.
|
|
|
Re: cgcolor load color to the current color table. [message #78136 is a reply to message #78135] |
Wed, 26 October 2011 10:50  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Zhang Bo writes:
> With decomposed color, how to show color gradient in a contour plot?
> The we I can image is by setting an array of gradient numbers for
> colors every time, which seems not quite convenient.
I'm not sure what you are asking. cgContour works with
color tables and color values in the normal way. It does
ALL its drawing in decomposed color mode, if at all possible.
Device, Decomposed=1
Loadct, 5
cgContour, cgDemoData(2), /Fill, NLEVELS=15
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: cgcolor load color to the current color table. [message #78137 is a reply to message #78136] |
Wed, 26 October 2011 10:40  |
Zhang Bo
Messages: 22 Registered: October 2011
|
Junior Member |
|
|
On Oct 25, 10:16 pm, David Fanning <n...@dfanning.com> wrote:
> Zhang Bo writes:
>> when I use color = cgcolor('black'), it will load black in to color
>> index 84, which mass up my following TV and colorbar. How to avoid
>> this?
>
> Use decomposed color. :-)
>
> Or, if you insist on using the brain-dead TV command and
> indexed color load your color tables just before you display
> your image. With cgColorbar, use the AnnotateColor keyword
> rather than the Color keyword to specify your drawing color.
>
> But, really, use decomposed color. For everything. Really. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
With decomposed color, how to show color gradient in a contour plot?
The we I can image is by setting an array of gradient numbers for
colors every time, which seems not quite convenient.
|
|
|
Re: cgcolor load color to the current color table. [message #78143 is a reply to message #78137] |
Tue, 25 October 2011 20:19  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Zhang Bo writes:
> when I use color = cgcolor('black'), it will load black in to color
> index 84, which mass up my following TV and colorbar. How to avoid
> this?
If you have an index, say 254, where you typically load drawing
colors, you can have cgColor load the black color there:
IDL> color = cgColor('black', 254)
It only chooses 84 as the color index in the absence of
other instructions. But, really, use decomposed color
all the time, so no colors ever have to be loaded
anywhere. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: cgcolor load color to the current color table. [message #78145 is a reply to message #78143] |
Tue, 25 October 2011 19:16  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Zhang Bo writes:
> when I use color = cgcolor('black'), it will load black in to color
> index 84, which mass up my following TV and colorbar. How to avoid
> this?
Use decomposed color. :-)
Or, if you insist on using the brain-dead TV command and
indexed color load your color tables just before you display
your image. With cgColorbar, use the AnnotateColor keyword
rather than the Color keyword to specify your drawing color.
But, really, use decomposed color. For everything. Really. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|