Re: iplot and color tables? [message #49094] |
Mon, 26 June 2006 15:49  |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
maye wrote:
> Hi!
> I can't seem to find a way to use simple color tables in iPlot, like it
> is possible to do in iimage.
> Do I really have to know the RGB values of useful colors for iPlot's
> COLOR keyword, just to distinguish 10 graphs I overplot on each other,
> or do I overlook something?
> If giving the color in RGB values is really the only way to have nicely
> distinguishable graphs in iPlot, does anybody happen to have a list of
> let's say, 16 different RGB values for that?
> I see, that there is a way to construct your own color table.. but.. do
> I really have to? :)
> I'm a scientist, who does not necessarily want to know about RGB values
> of useful colors, but just wants to have different plots nicely
> distinguished by colors.
> In PLOT I just can multiply/add my FOR-variable to change the value for
> the color keyword, but in iPlot? Any suggestions?
> Many thanks in advance,
> Michael
>
Once you have created the plot, you can manually change its color:
Right-click onto the plot line and choose "Properties". Once you click
into the Color field, you can pick one of the predefined colors, or
create your own color.
From the command line, it looks to me as if there is no way other than
specifying the RGB vector. But as David wrote, you can leave that job to
his fsc_color() routine.
Benjamin
|
|
|
Re: iplot and color tables? [message #49095 is a reply to message #49094] |
Mon, 26 June 2006 12:47   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
maye writes:
> I can't seem to find a way to use simple color tables in iPlot, like it
> is possible to do in iimage.
> Do I really have to know the RGB values of useful colors for iPlot's
> COLOR keyword, just to distinguish 10 graphs I overplot on each other,
> or do I overlook something?
> If giving the color in RGB values is really the only way to have nicely
> distinguishable graphs in iPlot, does anybody happen to have a list of
> let's say, 16 different RGB values for that?
> I see, that there is a way to construct your own color table.. but.. do
> I really have to? :)
> I'm a scientist, who does not necessarily want to know about RGB values
> of useful colors, but just wants to have different plots nicely
> distinguished by colors.
> In PLOT I just can multiply/add my FOR-variable to change the value for
> the color keyword, but in iPlot? Any suggestions?
FSC_COLOR has 110 (or so) "named" colors you can specify.
You can return the RGB triple for each color by specifying
the TRIPLE keyword. Unfortunately, the triple comes back
as a 1 by 3 array (so it can be loaded with TVLCT), so
you need to transpose it to use it with the object graphics
system:
iplot, COLOR=Transpose(FSC_COLOR('indian red', /Triple)), [0,1]
To see all the colors available, type this:
color = FSC_Color(/Select)
You will need these programs:
http://www.dfanning.com/programs/fsc_color.pro
http://www.dfanning.com/programs/pickcolorname.pro
The program can be easily modified to work directly
with IPLOT.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: iplot and color tables? [message #49186 is a reply to message #49094] |
Tue, 27 June 2006 08:29  |
maye
Messages: 29 Registered: June 2006
|
Junior Member |
|
|
>
> Once you have created the plot, you can manually change its color:
> Right-click onto the plot line and choose "Properties". Once you click
> into the Color field, you can pick one of the predefined colors, or
> create your own color.
>
> From the command line, it looks to me as if there is no way other than
> specifying the RGB vector. But as David wrote, you can leave that job to
> his fsc_color() routine.
>
Well, there is a way to control and change itool objects after creation
via the object interface to the itools. (Getting the object with
ITGETCURRENT() and so on).
But that's after creation of the object, this should (and is) be
controllable at object creation time, I just wished it would be a bit
simpler or more direct, so that my loop variable could control the
color used. But anyway, with David's code it is easily done now.
But I wouldn't want to hand-change the color of 10 graphs in 10 plots
(=100) with the visualization browser in the itools! ;)
Greetings,
Michael
|
|
|
Re: iplot and color tables? [message #49187 is a reply to message #49095] |
Tue, 27 June 2006 08:19  |
maye
Messages: 29 Registered: June 2006
|
Junior Member |
|
|
David Fanning schrieb:
> maye writes:
>
>> I can't seem to find a way to use simple color tables in iPlot, like it
>> is possible to do in iimage.
>> Do I really have to know the RGB values of useful colors for iPlot's
>> COLOR keyword, just to distinguish 10 graphs I overplot on each other,
>> or do I overlook something?
>> If giving the color in RGB values is really the only way to have nicely
>> distinguishable graphs in iPlot, does anybody happen to have a list of
>> let's say, 16 different RGB values for that?
>> I see, that there is a way to construct your own color table.. but.. do
>> I really have to? :)
>> I'm a scientist, who does not necessarily want to know about RGB values
>> of useful colors, but just wants to have different plots nicely
>> distinguished by colors.
>> In PLOT I just can multiply/add my FOR-variable to change the value for
>> the color keyword, but in iPlot? Any suggestions?
>
> FSC_COLOR has 110 (or so) "named" colors you can specify.
> You can return the RGB triple for each color by specifying
> the TRIPLE keyword. Unfortunately, the triple comes back
> as a 1 by 3 array (so it can be loaded with TVLCT), so
> you need to transpose it to use it with the object graphics
> system:
>
> iplot, COLOR=Transpose(FSC_COLOR('indian red', /Triple)), [0,1]
>
> To see all the colors available, type this:
>
> color = FSC_Color(/Select)
>
> You will need these programs:
>
> http://www.dfanning.com/programs/fsc_color.pro
> http://www.dfanning.com/programs/pickcolorname.pro
>
One also needs error_message.pro
Hi!
Thanks for your prompt reply! I'm glad that your fame leaves you time
to read and write in these forums so actively!
Some comments on your help:
After also downloading error_message.pro from your website, your
programs work nicely, and i can for example, put the pickcolorname
inside the fsc_color, so that i am asked everytime what color this plot
should be in, that's quite nice and comfortable!
But in the case of doing very often plots with 10 graphs it becomes
quickly tiring.
So, what I did, is to create a string array with ten names, created
with pickcolorname. And this array I use to control fsc_color in my
loop for the graph creation.
But maybe sometimes I don't want to create these names before, but just
a simple number access, so I guess i will change your code to give me
that. Or is an integer access already built in, and i haven't seen it?
Anyway, thanks for your help (and sorry that USA didn't move on into
the WorldCup's last round of 16. ;)
Michael
|
|
|