[R] Strategy for creating a palette...?
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Wed Aug 8 11:47:31 CEST 2001
Kjetil Kjernsmo <kjetil.kjernsmo at astro.uio.no> writes:
> Dear all,
>
> I'm generally not a big fan of GUIs, but I have just discovered one thing
> where a GUI would be a nice thing: creating color palettes.
Actually not. Just take a program which allows you to customize colors
graphically and try to match the selection to an existing color.
> I'm creating an "image", for transparencies for a lecture I'm giving, so
> this is going to look great... :-) What I'm out for, is to make green
> tones and red tones, and a relatively sharp break between them. This break
> will signify a rejection region for a test.
>
> I've spent all evening, er, night trying to tune this, but it's still
> ugly. My best shot so far is this:
> greenred <- palette(rgb(exp(-(0:255)/80), exp(-(0:255)/80), 0))
Um, that doesn't mean what I think you think it means.
Point 1: palette() returns the previous palette:
> greenred <- palette(rgb(exp(-(0:255)/80), exp(-(0:255)/80), 0))
> greenred
[1] "black" "red" "green3" "blue" "cyan" "magenta" "yellow"
[8] "white"
Point2: rgb(exp(-(0:255)/80), exp(-(0:255)/80), 0) have equal amounts
of red and green, so is varying degrees of dirty yellow.
> Any ideas...? Anybody got a pretty palette for this purpose? Also, I'd
> like to tune the palette so that the break between green and red happens
> at a value of e.g. 0.05. How would I do that?
A code example that actually worked might have helped us...
Instinctively, I'd suggest you should play with hsv().
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list