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

Home » Public Forums » archive » Coloring labelled regions (or states)
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: Coloring labelled regions (or states) [message #92067 is a reply to message #92066] Tue, 06 October 2015 08:18 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 10/6/15 9:08 am, Helder wrote:
> On Tuesday, October 6, 2015 at 4:12:22 PM UTC+2, Phillip Bitzer wrote:
>> On Tuesday, October 6, 2015 at 7:39:53 AM UTC-5, Helder wrote:
>>> Hi,
>>> I have an image where I identified regions (label_region). These regions are confining with one another as states do on a political map.
>>> Can you suggest me a way to generate a colored image, so that I don't have neighboring "states" with too similar colors?
>>>
>>> I can fill in the array values, I just dunno where to get appropriate colors or how to chose which one gets which.
>>>
>>
>> I always use this for help picking a palette:
>>
>> http://colorbrewer2.org/
>>
>> Sounds like you want a "qualitative" table.
>
> Hi,
> that's a beautiful website. However, is there an easy way to automatically assign the colors?
> For instance, I chose these colors (qualitative, 9 data classes, printer friendly):
> 228,26,28
> 55,126,184
> 77,175,74
> 152,78,163
> 255,127,0
> 255,255,51
> 166,86,40
> 247,129,191
> 153,153,153
>
> How to I assign them? Is there an "ordered" way to do this or just
from 1 to 9 looking at the result at the end?
>
> Thanks,
> Helder
>

Yes, this is what indexed color mode is for:

r = [228, 55, 77, 152, 255, 255, 166, 247, 153]
g = [26, 126, 175, 78, 127, 255, 86, 129, 153]
b = [28, 184, 74, 163, 0, 51, 40, 191, 153]

tvlct, r, g, b
device, decomposed=0

Then, just use COLOR=0, COLOR=1, etc.

Deciding on which areas just which colors is another matter...

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: formatting numbers in widget_propertysheet
Next Topic: Geometric mismatch using cgImage and cgDrawShapes

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

Current Time: Wed Oct 08 15:56:17 PDT 2025

Total time taken to generate the page: 0.00376 seconds