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

Home » Public Forums » archive » Re: Easy colours?
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: Easy colours? [message #82072 is a reply to message #82069] Thu, 15 November 2012 16:44 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
markjamie@gmail.com writes:

> I often find myself needing to plot graphs (in direct or new graphics) for an unknown number of data series. To differentiate between them in the plot I colour each line / symbols. Since most of the time I have less than 10 series I usually just define an array of 10 specific colours and select from this on the plot command. However, this method has problems if you breach the number of pre-defined colours.
>
> Ideally, I'd like to be able to load a colour table and then have an easy way to select 'x' equally spaced colours across the colour table.
>
> For example, if my colour table went from blue-yellow-pink-green-red and I had 5 data series, I would like to be able to access each colour using a fractional number specifying how far across th colour table
>
> E.g.
> Loadct,39
> Plot, Series1, color=mycolour(0)
> OPlot,Series2, color= mycolour(0.25)
> OPlot,series3, color=mycolour(0.5)
> OPlot,series4, color=mycolour(0.75)
> OPlot,series5,color=mycolour(1)
>
> I've never found a way to do this in IDL - perhaps I'm missing something really simple...

Loadct, 39, NCOLORS=NumberInSeries, BOTTOM=1
mycolour = Bindgen(NumberInSeries)+1

You might prefer to use cgLoadCT instead, since it has a
CLIP keyword that is useful for trimming off colors at
one or both ends of the color table before selecting
the equally spaced colors.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL HDF5 H5P
Next Topic: Re: Reading sequence of HDF files fails after some number of successes

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

Current Time: Wed Oct 08 15:27:38 PDT 2025

Total time taken to generate the page: 0.00464 seconds