Martin Maechler
1997-Jun-30 10:17 UTC
R-beta: Color specifications -- simple 'bg' / 'fg' swapping -- proposal
Consider the following example : data(iris) attach(iris) par(bg = 'midnightblue', fg = 'yellow') plot(Petal.Length, Petal.Width, main = "Fisher's iris data", sub = "3 kinds") ##>>> gives black axis labels and titles ... ## Currently, the plot I want is produced by par(bg = 'midnightblue', fg = 'yellow', col.axis='yellow', col.lab='yellow', col.main='yellow', col.sub='yellow') plot(Petal.Length, Petal.Width, main = "Fisher's iris data", sub = "3 kinds") -------------------------------------------- Why is this ? --- R's extra flexibility in specifying colors ---> x11() > unlist(par(as.list(c("bg","fg",.Pars[ "col" == substr(.Pars,1,3)]))))bg fg col col.axis col.lab col.main col.sub "white" "black" "black" "black" "black" "black" "black" I.e., this was that default> par(col="blue") > unlist(par(as.list(c("bg","fg",.Pars[ "col" == substr(.Pars,1,3)]))))bg fg col col.axis col.lab col.main col.sub "white" "black" "blue" "black" "black" "black" "black"> par(col="black") # set it back#-- Here I would have liked to change ALL the foreground colors : --------------------------------> par(fg="blue") > unlist(par(as.list(c("bg","fg",.Pars[ "col" == substr(.Pars,1,3)]))))bg fg col col.axis col.lab col.main col.sub "white" "blue" "blue" "black" "black" "black" "black" Only the 'col' has been changed, but not col.axis, col.lab, ... -------- Do we need another 'par' parameter to do this, or couldn't the semantics of "fg" be changed such that the example above works as I had expected? Martin Maechler <maechler at stat.math.ethz.ch> <>< Seminar fuer Statistik, SOL G1 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1086 http://www.stat.math.ethz.ch/~maechler/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Apparently Analagous Threads
- color of axis lines (PR#1470)
- PDF graphics -- color weirdness (PR#2281)
- trellis.par.set and grid : how to set by default that I want a grid on my graphes ?
- Colorramp in Maptools, how to choose min and max values for the fg= argument
- xlim=c(min(x), max(x)) still produces extra margin on both sides of x axis in plot()