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 
Return to the default flat view Create a new topic Submit Reply
Re: Plot colors [message #84984 is a reply to message #84967] Thu, 20 June 2013 10:24 Go to previous messageGo to previous 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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 19:47:25 PDT 2025

Total time taken to generate the page: 0.00438 seconds