Easy colours? [message #82074] |
Thu, 15 November 2012 16:23 |
markjamie
Messages: 30 Registered: November 2012
|
Member |
|
|
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...
Any thoughts?
|
|
|