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

Home » Public Forums » archive » Plot colors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Plot colors [message #84967] Wed, 19 June 2013 23:59 Go to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
What are your favorite colors for overplotting several data sets in the
same diagram? (I'm assuming Coyote graphics here.) You'd want them to be
easy to tell apart and to have a good and similar contrast against the
(white) background.

For two colors it's easy: red and blue.

But already for three colors, if you add green you get something with
less contrasty. And for more colors, if you add the complement colors
cyan, magenta, and yellow, both yellow and cyan have the same problem.
So then I usually inspect the color names in cgcolor and pick darker
versions of the too light colors and some redder version of yellow. And
if I need more than six I don't really know what to do...

So, what is a good strategy? Do you have a good list that you always
use, and truncate it to the needed length? Or do you start the list
differently depending on how long it has to be? Has anybody written a
function for this? Something like

function plotcolors, index, Ncolors


/Mats
Re: Plot colors [message #84973 is a reply to message #84967] Thu, 20 June 2013 05:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

> What are your favorite colors for overplotting several data sets in the
> same diagram? (I'm assuming Coyote graphics here.) You'd want them to be
> easy to tell apart and to have a good and similar contrast against the
> (white) background.
>
> For two colors it's easy: red and blue.
>
> But already for three colors, if you add green you get something with
> less contrasty. And for more colors, if you add the complement colors
> cyan, magenta, and yellow, both yellow and cyan have the same problem.
> So then I usually inspect the color names in cgcolor and pick darker
> versions of the too light colors and some redder version of yellow. And
> if I need more than six I don't really know what to do...
>
> So, what is a good strategy? Do you have a good list that you always
> use, and truncate it to the needed length? Or do you start the list
> differently depending on how long it has to be? Has anybody written a
> function for this?

Ah, good question. I pick drawing colors based on the light at a
particular time of day (mornings are usually blue, afternoons tend to be
shades of red), what flowers are blooming in the rock garden outside my
office window, the particular "gestalt" of the graphics display I am
creating (an IDL feng shui thing), and my emotional state. (You don't
want to see the colors I pick when I am doing something with function
graphics!)

Every plot seems to be different. I use cgPickColorName to help me
decide. :-)

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.")
Re: Plot colors [message #84978 is a reply to message #84973] Thu, 20 June 2013 08:44 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
On 2013-06-20 14:28, David Fanning wrote:
> Mats Löfdahl writes:
>
>> What are your favorite colors for overplotting several data sets in the
>> same diagram? (I'm assuming Coyote graphics here.) You'd want them to be
>> easy to tell apart and to have a good and similar contrast against the
>> (white) background.
>>
>> For two colors it's easy: red and blue.
>>
>> But already for three colors, if you add green you get something with
>> less contrasty. And for more colors, if you add the complement colors
>> cyan, magenta, and yellow, both yellow and cyan have the same problem.
>> So then I usually inspect the color names in cgcolor and pick darker
>> versions of the too light colors and some redder version of yellow. And
>> if I need more than six I don't really know what to do...
>>
>> So, what is a good strategy? Do you have a good list that you always
>> use, and truncate it to the needed length? Or do you start the list
>> differently depending on how long it has to be? Has anybody written a
>> function for this?
>
> Ah, good question. I pick drawing colors based on the light at a
> particular time of day (mornings are usually blue, afternoons tend to be
> shades of red), what flowers are blooming in the rock garden outside my
> office window, the particular "gestalt" of the graphics display I am
> creating (an IDL feng shui thing), and my emotional state. (You don't
> want to see the colors I pick when I am doing something with function
> graphics!)
>
> Every plot seems to be different. I use cgPickColorName to help me
> decide. :-)

OK, so you're no better than me... :o)

But I can't help thinking that there should be a better way. Something
like picking colors that are evenly distributed in some color space and
at the same distance from white? I don't know. I think I can handle
thinking about gray scale pretty well but colors are trickier.
Re: Plot colors [message #84979 is a reply to message #84978] Thu, 20 June 2013 08:52 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

> OK, so you're no better than me... :o)

Yes, that's what I'm saying. :-)

> But I can't help thinking that there should be a better way. Something
> like picking colors that are evenly distributed in some color space and
> at the same distance from white? I don't know. I think I can handle
> thinking about gray scale pretty well but colors are trickier.

Well, I do tend to prefer the number 6 values in the Brewer color tables
as plot colors (these are on the right-hand side of cgPickColorName, to
the right of the column of beige colors, "red6", "pbg6", "ygb6" etc.).
These are probably constructed from an HSV color scheme along the lines
you suggest.

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.")
Re: Plot colors [message #84980 is a reply to message #84979] Thu, 20 June 2013 09:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> Mats Löfdahl writes:
>
>> OK, so you're no better than me... :o)
>
> Yes, that's what I'm saying. :-)
>
>> But I can't help thinking that there should be a better way. Something
>> like picking colors that are evenly distributed in some color space and
>> at the same distance from white? I don't know. I think I can handle
>> thinking about gray scale pretty well but colors are trickier.
>
> Well, I do tend to prefer the number 6 values in the Brewer color tables
> as plot colors (these are on the right-hand side of cgPickColorName, to
> the right of the column of beige colors, "red6", "pbg6", "ygb6" etc.).
> These are probably constructed from an HSV color scheme along the lines
> you suggest.

As you can see by the response to your question, there are only three
people in the world who could give a flying fig about color in their
graphics plots, and none of them work at ExelisVis, as you can tell from
the hideous yellow that is used as the default color of the Surface
function.

I'm just saying, you may have to look elsewhere for color advice. ;-)

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.")
Re: Plot colors [message #84982 is a reply to message #84980] Thu, 20 June 2013 09:54 Go to previous messageGo to next message
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On Thursday, June 20, 2013 10:10:53 AM UTC-6, David Fanning wrote:
> David Fanning writes:
>
> As you can see by the response to your question, there are only three
> people in the world who could give a flying fig about color in their
> graphics plots, and none of them work at ExelisVis, as you can tell from
> the hideous yellow that is used as the default color of the Surface
> function.
>

Careful, that's Green Bay Packers yellow.

mp
Re: Plot colors [message #84983 is a reply to message #84982] Thu, 20 June 2013 09:55 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Piper writes:

> Careful, that's Green Bay Packers yellow.

Ah, should have known! ;-)

Cheers,

David

P.S. Only thing worse would have been Broncos orange.

--
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.")
Re: Plot colors [message #84984 is a reply to message #84967] Thu, 20 June 2013 10:24 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 6/20/13 12:59 AM, Mats Löfdahl wrote:
> What are your favorite colors for overplotting several data sets in the
> same diagram? (I'm assuming Coyote graphics here.) You'd want them to be
> easy to tell apart and to have a good and similar contrast against the
> (white) background.
>
> For two colors it's easy: red and blue.
>
> But already for three colors, if you add green you get something with
> less contrasty. And for more colors, if you add the complement colors
> cyan, magenta, and yellow, both yellow and cyan have the same problem.
> So then I usually inspect the color names in cgcolor and pick darker
> versions of the too light colors and some redder version of yellow. And
> if I need more than six I don't really know what to do...
>
> So, what is a good strategy? Do you have a good list that you always
> use, and truncate it to the needed length? Or do you start the list
> differently depending on how long it has to be? Has anybody written a
> function for this? Something like
>
> function plotcolors, index, Ncolors
>
>
> /Mats

This is what the qualitative color tables in the Brewer color tables are
for.

Checkout color tables 27-34 in the Brewer color tables (the second set
of color tables) on:

http://docs.idldev.com/mglib/vis/color/mg_loadct.html

To use one of these, say 27, just do:

mg_loadct, /brewer, 27

and then just use COLOR=0, COLOR=1, ... COLOR=11 (color table 27 has 12
values).

The Brewer color tables are included in IDL now, but they interpolated
intermediate values for the qualitative color tables, so you have to use
something like the following to get the 5th of the 12 values in a color
table:

COLOR=5 * 256 / 12

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: Plot colors [message #84985 is a reply to message #84984] Thu, 20 June 2013 11:25 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
On 2013-06-20 19:24, Michael Galloy wrote:
> On 6/20/13 12:59 AM, Mats Löfdahl wrote:
>> What are your favorite colors for overplotting several data sets in the
>> same diagram? (I'm assuming Coyote graphics here.) You'd want them to be
>> easy to tell apart and to have a good and similar contrast against the
>> (white) background.
>>
>> For two colors it's easy: red and blue.
>>
>> But already for three colors, if you add green you get something with
>> less contrasty. And for more colors, if you add the complement colors
>> cyan, magenta, and yellow, both yellow and cyan have the same problem.
>> So then I usually inspect the color names in cgcolor and pick darker
>> versions of the too light colors and some redder version of yellow. And
>> if I need more than six I don't really know what to do...
>>
>> So, what is a good strategy? Do you have a good list that you always
>> use, and truncate it to the needed length? Or do you start the list
>> differently depending on how long it has to be? Has anybody written a
>> function for this? Something like
>>
>> function plotcolors, index, Ncolors
>>
>>
>> /Mats
>
> This is what the qualitative color tables in the Brewer color tables are
> for.
>
> Checkout color tables 27-34 in the Brewer color tables (the second set
> of color tables) on:
>
> http://docs.idldev.com/mglib/vis/color/mg_loadct.html
>
> To use one of these, say 27, just do:
>
> mg_loadct, /brewer, 27
>
> and then just use COLOR=0, COLOR=1, ... COLOR=11 (color table 27 has 12
> values).
>
> The Brewer color tables are included in IDL now, but they interpolated
> intermediate values for the qualitative color tables, so you have to use
> something like the following to get the 5th of the 12 values in a color
> table:
>
> COLOR=5 * 256 / 12

Brewer table 32 (Dark2) might be useful. Maybe 29 (Set1) as well. The
rest of them look like they include colors that are too bright for lines
on a white background.

The Dark2 colors look similar to the colors David suggested. Are they
the same? Or how would I refer to them in the cgcolor naming scheme? How
about the Set1 colors?
Re: Plot colors [message #84995 is a reply to message #84980] Thu, 20 June 2013 20:22 Go to previous messageGo to next message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Thursday, June 20, 2013 10:10:53 AM UTC-6, David Fanning wrote:
> David Fanning writes:
>
>
>
>>
>
>> Mats Löfdahl writes:
>
>>
>
>>> OK, so you're no better than me... :o)
>
>>
>
>> Yes, that's what I'm saying. :-)
>
>>
>
>>> But I can't help thinking that there should be a better way. Something
>
>>> like picking colors that are evenly distributed in some color space and
>
>>> at the same distance from white? I don't know. I think I can handle
>
>>> thinking about gray scale pretty well but colors are trickier.
>
>>
>
>> Well, I do tend to prefer the number 6 values in the Brewer color tables
>
>> as plot colors (these are on the right-hand side of cgPickColorName, to
>
>> the right of the column of beige colors, "red6", "pbg6", "ygb6" etc.).
>
>> These are probably constructed from an HSV color scheme along the lines
>
>> you suggest.
>
>
>
> As you can see by the response to your question, there are only three
>
> people in the world who could give a flying fig about color in their
>
> graphics plots, and none of them work at ExelisVis, as you can tell from
>
> the hideous yellow that is used as the default color of the Surface
>
> function.
>
>
>
> I'm just saying, you may have to look elsewhere for color advice. ;-)
>
>
>
> 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.")

At the risk of rudely double-posting... A general rule of thumb is that if you print your color output on a black and white printer and you are unable to distinguish the data you're attempting to highlight, you're using an improper color table or display idiom. There will be someone in your audience (perhaps someone who controls your project's funding) who won't see what's obvious to you.

You might be surprised by the number of folks in VIS consulting who have various issues distinguishing colors, whether it's a common problem like red/green deficiency as I have, or something more obscure. It makes us think out of the box, relative to color information.

When in doubt we rely more on line thicknesses and styles, and try to make the scenes less complex.
Re: Plot colors [message #84996 is a reply to message #84995] Thu, 20 June 2013 20:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jim P writes:

> You might be surprised by the number of folks in VIS consulting who have various issues distinguishing colors, whether it's a common problem like red/green deficiency as I have, or something more obscure. It makes us think out of the box, relative to color information.

I once had a blind person in an IDL programming class. I did a LOT of
out of box thinking that week, I'll tell you. ;-)

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.")
Re: Plot colors [message #85148 is a reply to message #84967] Tue, 09 July 2013 15:56 Go to previous messageGo to next message
allisonjaynes is currently offline  allisonjaynes
Messages: 26
Registered: May 2012
Junior Member
I love the spectral color table (cgloadct, 74, /reverse) plotted over a gray background, not white. Use CgColorFill to make the interior of the plotting region gray. (I just reverse it because I like things to go from cool colors to warm, rather than the other way around.)

As long as you have 16 or less different traces, just do:
DeltaColor=fix(255/(Num_Traces-1))
Colors=indgen(Num_Traces)*DeltaColor

(If you need more than 16 colors on one plot, you should rearrange the scheme entirely...)

Another good thing to do is vary the PSYM and THICK incrementally for each trace.

Good luck! Pretty plots are few and far between.
Re: Plot colors [message #85163 is a reply to message #84967] Wed, 10 July 2013 10:24 Go to previous messageGo to next message
Chip Helms is currently offline  Chip Helms
Messages: 24
Registered: November 2012
Junior Member
I'm sure there's something out there in the scientific literature that would tell us the answer :D (I'm going to stop myself before I actually end up reading several papers about color choice instead of doing work)

http://scholar.google.com/scholar?hl=en&q=color+choices+ for+graphics&btnG=&as_sdt=1%2C33&as_sdtp=
Re: Plot colors [message #85164 is a reply to message #85163] Wed, 10 July 2013 10:29 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Chip Helms writes:

>
> I'm sure there's something out there in the scientific literature that would tell us the answer :D (I'm going to stop myself before I actually end up reading several papers about color choice instead of doing work)
>
> http://scholar.google.com/scholar?hl=en&q=color+choices+ for+graphics&btnG=&as_sdt=1%2C33&as_sdtp=

One advantage of the CoolHelix color table Allison mentioned is that it
works great on both color and black and white printers:

http://www.ifweassume.com/2013/05/cubehelix-or-how-i-learned -to-
love.html

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL beginner-MPFIT questions
Next Topic: Speeding up data crunching using IDL_IDLBridge with asychronous execution

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

Current Time: Wed Oct 08 15:53:57 PDT 2025

Total time taken to generate the page: 0.00411 seconds