Re: [R] Drawing a colour wheel - bug in hcl?

From: Achim Zeileis <Achim.Zeileis_at_wu-wien.ac.at>
Date: Tue, 08 Jul 2008 00:12:50 +0200 (CEST)

On Mon, 7 Jul 2008, hadley wickham wrote:

>> If you replace this by
>> hcl$colour <- hcl(hcl$h, hcl$c, hcl$l, fixup = FALSE)
>>
>>> with(hcl, plot(x, y, col=colour, pch=20))
>>
>> Then, the resulting "wheel" has three overlapping "holes" corresponding to
>> the colors previously fixed.
>
> Oops, thanks for pointing that out.
>
>> Also, as hue/chroma correspond to polar coordinates in the UV plane of
>> CIELUV, it makes more sense to plot wheels in the hue/chroma plane for fixed
>> luminance. To draw a hue/luminance plane for fixed chroma is harder to
>> interpret geometrically.
>
> Oooh, I guess if I'd thought about that for a couple of seconds I
> would have a realised that! What are good values to use for luminance
> and chroma in that case?

There are some utility visualization functions in the devel-version of "colorspace" on R-Forge. Try:

source(url("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/paper/Colorspace/visualizations.R?rev=13&root=colorspace")) hue_chroma_plane()
chroma_luminance_plane()

> I can't seem to find a slice which gives me
> a decently wheel-like slice? Or should I just use fixup = TRUE, or
> accept that true colour wheels displayed on rgb monitors don't look
> like wheels?

They always look a bit awkward, more like rectangles or triangles, but you could limit the maximum chroma, then it looks a bit more like a wheel.

hue_chroma_plane(c = 0:50)

But you can never get the full wheel if you want to balance with respect to luminance. Or conversely, if you construct a wheel like

hue_saturation_plane()

then it is not balanced with respect to lumincance. Z

> Hadley
>
> --
> http://had.co.nz/
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 07 Jul 2008 - 22:17:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Jul 2008 - 22:31:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive