[R] venneuler (java?) color palette 0 - 1

Karl Brand k.brand at erasmusmc.nl
Mon Oct 11 15:37:03 CEST 2010


Hi Paul,

That's pretty much awesome. Thank you very much.

And combined with the colorspace package functions- rainbow_hcl() and 
sequential_hcl() -make color selection easy. One thing i was digging for 
was a function that yields a color palette *and* the hcl() call needed 
to produce it. This would help me better understand the hcl format. So 
where i can get the RGB codes like this-

 > rainbow_hcl(4)
[1] "#E495A5" "#ABB065" "#39BEB1" "#ACA4E2"
 >

- which is fine for color specification, is there a palette function 
that might help obtain the hcl() call needed to produce a given palette? 
ie., the 'h', 'c' and 'l' (and 'alpha' if appropriate) values for a 
given color/shade??

Thanks again and in advance for any further pointers,

Karl

On 10/10/2010 10:41 PM, Paul Murrell wrote:
> Hi
>
> On 11/10/2010 9:01 a.m., Karl Brand wrote:
>> Dear UseRs and DevelopeRs
>>
>> It would be helpful to see the color palette available in the
>> venneuler() function.
>>
>> The relevant par of ?venneuler states:
>>
>> "colors: colors of the circles as values between 0 and 1"
>>
>> -which explains color specification, but from what pallette? Short of
>> trial and error, i'd really appreciate if some one could help me locate
>> a "0 - 1" pallette for this function to aid with color selection.
>
> The color spec stored in the VennDiagram object is multiplied by 360 to
> give the "hue" component of an hcl() colour specification. For example,
> 0.5 would mean the colour hcl(0.5*360, 130, 60)
>
> Alternatively, you can control the colours when you call plot, for
> example, ...
>
> plot(ve, col=c("red", "green", "blue"))
>
> ... should work.
>
> Paul
>
>> FWIW, i tried the below code and received the displayed error. I failed
>> to turn up any solutions to this error...
>>
>> Any suggestions appreciated,
>>
>> Karl
>>
>>
>> library(venneuler)
>>
>> ve<- venneuler(c("A"=1, "B"=2, "C"=3, "A&C"=0.5, "A&B&C"=0.1))
>>
>> class(ve)
>> [1] "VennDiagram"
>>
>> ve$colors<- c("red", "green", "blue")
>>
>> plot(ve)
>>
>> Error in col * 360 : non-numeric argument to binary operator
>>
>

-- 
Karl Brand <k.brand at erasmusmc.nl>
Department of Genetics
Erasmus MC
Dr Molewaterplein 50
3015 GE Rotterdam
P +31 (0)10 704 3409 | F +31 (0)10 704 4743 | M +31 (0)642 777 268



More information about the R-help mailing list