Plot colors [message #84967] |
Wed, 19 June 2013 23:59  |
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   |
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   |
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   |
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   |
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 #84984 is a reply to message #84967] |
Thu, 20 June 2013 10:24   |
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   |
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   |
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.
|
|
|
|
|
|
|