Hi All, I need a small help with following code: I'm trying to convert "dashed lines" to regular ones; and changing default "blue" border color to say "black"... but I'm doing it wrong and its not working. Can anyone help please. Thanks, Code: require(lattice) ex <- data.frame(x=1:10, y=rep(c("A","B"), 5)) bwplot(y~x, data=ex, panel=function(x,y,...) { panel.bwplot(x, y, pch="|", border="black", lty=1,...) } ) [[alternative HTML version deleted]]
you can use parameters: trellis.par.set (box.rectangle = modifyList (trellis.par.get ("box.rectangle"), list (col = "black"))) bwplot(y~x, data=ex, pch = "|") I think the others go along the same line. Look into panel.bwplot to see what parameters are used to produce what. HTH Claudia Kim Jung Hwa wrote:> Hi All, > > I need a small help with following code: I'm trying to convert "dashed > lines" to regular ones; and changing default "blue" border color to say > "black"... but I'm doing it wrong and its not working. Can anyone help > please. Thanks, > > Code: > require(lattice) > ex <- data.frame(x=1:10, y=rep(c("A","B"), 5)) > bwplot(y~x, data=ex, > panel=function(x,y,...) { > panel.bwplot(x, y, pch="|", border="black", lty=1,...) > } > ) > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
Try this: bwplot(y~x, data=ex, pch = "|", par.settings = list(box.rectangle = list(col = 'black'))) On Mon, Mar 1, 2010 at 1:09 PM, Kim Jung Hwa <kimhwamaillist at gmail.com> wrote:> Hi All, > > I need a small help with following code: I'm trying to convert "dashed > lines" to regular ones; and changing default "blue" border color to say > "black"... but I'm doing it wrong and its not working. Can anyone help > please. Thanks, > > Code: > require(lattice) > ex <- data.frame(x=1:10, y=rep(c("A","B"), 5)) > bwplot(y~x, data=ex, > ?panel=function(x,y,...) { > ? panel.bwplot(x, y, pch="|", border="black", lty=1,...) > ?} > ) > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
In complement to Dallazuanna's solution, use box.umbrella=list() inside par.settings() to change the default color and line type specification: bwplot(y~x, data=ex, pch="|", par.settings=list(box.rectangle=list(col="black"), box.umbrella=list(lty=1, col="black")) ) Sincerely. Walmes Zeviani. Lavras - MG, Brasil. ----- ..ooo0 ................................................................................................... ..(....)... 0ooo... Walmes Zeviani ...\..(.....(.....)... Master in Statistics and Agricultural Experimentation ....\_)..... )../.... walmeszeviani at hotmail.com, Lavras - MG, Brasil ............ (_/............................................................................................ -- View this message in context: http://n4.nabble.com/help-with-lattice-boxplots-tp1573781p1573896.html Sent from the R help mailing list archive at Nabble.com.