Hello, A made a xyplot using the lattice library in R (latest version). The publisher of our paper has requested: 1. all tick marks should point inwards instead of outwards. 2. All lines should be thicker (lines, axes, boxes, etc. Everything). Lines is easy...I used: lwd=1.5 but what about the lines of the axes, and the lines that build up the plot itself?....? Any suggestions? Kind regards, Piet Bell --------------------------------- [[alternative HTML version deleted]]
Piet Bell wrote:> Hello, > A made a xyplot using the lattice library in R (latest version). > > The publisher of our paper has requested: > > 1. all tick marks should point inwards instead of outwards. > > 2. All lines should be thicker (lines, axes, boxes, etc. Everything). Lines is easy...I used: lwd=1.5 but what about the lines of the axes, and the lines that build up the plot itself?....? > > Any suggestions?library(lattice) trellis.device() # to find all components with lwd setting # names(trellis.par.get()[grep("lwd", trellis.par.get())]) trellis.par.set( add.line = list(lwd=1.5), plot.polygon = list(lwd=1.5), box.rectangle = list(lwd=1.5), box.umbrella = list(lwd=1.5), dot.line = list(lwd=1.5), plot.line = list(lwd=1.5), reference.line = list(lwd=1.5), strip.border = list(lwd=1.5), superpose.line = list(lwd=1.5), superpose.polygon = list(lwd=1.5), axis.line = list(lwd=1.5), box.3d = list(lwd=1.5)) xyplot(rnorm(5) ~ 1:5, type = "b", scales = list(x = list(tck = -1), y = list(tck = -1)))> Kind regards, > > Piet Bell > > > --------------------------------- > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. > >-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894
Look through the output of trellis.par.get() for the right parameters or when all else fails use grid (which we use below for the box around the panel since I could not locate the parameter): library(lattice) library(grid) x <- 1:12 g <- gl(3,4) lwd <- 3 xyplot(x ~ x | g, type = "l", lwd = lwd, scales = list(tck = -1, lwd = lwd), par.settings = list(add.text = list(lwd = lwd), strip.border = list(lwd = lwd)), panel = function(...) { grid.rect(gp = gpar(lwd = lwd)) panel.xyplot(...) } ) On 8/24/06, Piet Bell <pj.bell at yahoo.co.uk> wrote:> Hello, > A made a xyplot using the lattice library in R (latest version). > > The publisher of our paper has requested: > > 1. all tick marks should point inwards instead of outwards. > > 2. All lines should be thicker (lines, axes, boxes, etc. Everything). Lines is easy...I used: lwd=1.5 but what about the lines of the axes, and the lines that build up the plot itself?....? > > Any suggestions? > > Kind regards, > > Piet Bell > > > --------------------------------- > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
Here is a way to automate finding the lwd= parameters. library(lattice) # test data x <- 1:12 g <- gl(3, 4) lwd <- 3 # set parameters par <- trellis.par.get() par <- lapply(par, function(x) replace(x, names(x) == "lwd", lwd)) xyplot(x ~ x | g, type = "l", par.settings = par) On 8/24/06, Chuck Cleland <ccleland at optonline.net> wrote:> Piet Bell wrote: > > Hello, > > A made a xyplot using the lattice library in R (latest version). > > > > The publisher of our paper has requested: > > > > 1. all tick marks should point inwards instead of outwards. > > > > 2. All lines should be thicker (lines, axes, boxes, etc. Everything). Lines is easy...I used: lwd=1.5 but what about the lines of the axes, and the lines that build up the plot itself?....? > > > > Any suggestions? > > library(lattice) > > trellis.device() > > # to find all components with lwd setting > # names(trellis.par.get()[grep("lwd", trellis.par.get())]) > > trellis.par.set( > add.line = list(lwd=1.5), > plot.polygon = list(lwd=1.5), > box.rectangle = list(lwd=1.5), > box.umbrella = list(lwd=1.5), > dot.line = list(lwd=1.5), > plot.line = list(lwd=1.5), > reference.line = list(lwd=1.5), > strip.border = list(lwd=1.5), > superpose.line = list(lwd=1.5), > superpose.polygon = list(lwd=1.5), > axis.line = list(lwd=1.5), > box.3d = list(lwd=1.5)) > > xyplot(rnorm(5) ~ 1:5, type = "b", > scales = list(x = list(tck = -1), y = list(tck = -1))) > > > Kind regards, > > > > Piet Bell > > > > > > --------------------------------- > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at stat.math.ethz.ch 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. > > > > > > -- > Chuck Cleland, Ph.D. > NDRI, Inc. > 71 West 23rd Street, 8th floor > New York, NY 10010 > tel: (212) 845-4495 (Tu, Th) > tel: (732) 512-0171 (M, W, F) > fax: (917) 438-0894 > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
That should read finding and setting. Chuck already showed how to find them. On 8/24/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:> Here is a way to automate finding the lwd= parameters. > > library(lattice) > > # test data > x <- 1:12 > g <- gl(3, 4) > lwd <- 3 > > # set parameters > par <- trellis.par.get() > par <- lapply(par, function(x) replace(x, names(x) == "lwd", lwd)) > xyplot(x ~ x | g, type = "l", par.settings = par) > > > On 8/24/06, Chuck Cleland <ccleland at optonline.net> wrote: > > Piet Bell wrote: > > > Hello, > > > A made a xyplot using the lattice library in R (latest version). > > > > > > The publisher of our paper has requested: > > > > > > 1. all tick marks should point inwards instead of outwards. > > > > > > 2. All lines should be thicker (lines, axes, boxes, etc. Everything). Lines is easy...I used: lwd=1.5 but what about the lines of the axes, and the lines that build up the plot itself?....? > > > > > > Any suggestions? > > > > library(lattice) > > > > trellis.device() > > > > # to find all components with lwd setting > > # names(trellis.par.get()[grep("lwd", trellis.par.get())]) > > > > trellis.par.set( > > add.line = list(lwd=1.5), > > plot.polygon = list(lwd=1.5), > > box.rectangle = list(lwd=1.5), > > box.umbrella = list(lwd=1.5), > > dot.line = list(lwd=1.5), > > plot.line = list(lwd=1.5), > > reference.line = list(lwd=1.5), > > strip.border = list(lwd=1.5), > > superpose.line = list(lwd=1.5), > > superpose.polygon = list(lwd=1.5), > > axis.line = list(lwd=1.5), > > box.3d = list(lwd=1.5)) > > > > xyplot(rnorm(5) ~ 1:5, type = "b", > > scales = list(x = list(tck = -1), y = list(tck = -1))) > > > > > Kind regards, > > > > > > Piet Bell > > > > > > > > > --------------------------------- > > > > > > [[alternative HTML version deleted]] > > > > > > ______________________________________________ > > > R-help at stat.math.ethz.ch 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. > > > > > > > > > > -- > > Chuck Cleland, Ph.D. > > NDRI, Inc. > > 71 West 23rd Street, 8th floor > > New York, NY 10010 > > tel: (212) 845-4495 (Tu, Th) > > tel: (732) 512-0171 (M, W, F) > > fax: (917) 438-0894 > > > > ______________________________________________ > > R-help at stat.math.ethz.ch 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. > > >
Piet Bell skreiv:> The?publisher?of?our?paper?has?requested: > > 1.?all?tick?marks?should?point?inwards?instead?of?outwards.Point him to William S. Cleveland?s excellent book /The Elements of Graphing Data/, where Cleveland strongly recommends that tick marks should point *outwards* ?because ticks that point inward can obscure data?. See the discussion on pages 31?35, and especially figure 2.12 and 2.13.> 2.?All?lines?should?be?thicker?(lines,?axes,?boxes,?etc.?Everything). > Lines?is?easy...I?used:??lwd=1.5???but?what?about?the?lines?of?the?axes, > and?the?lines?that?build?up?the?plot?itself?....?I find that library(Hmisc) setps("filename") # Or setpdf. You might also want to add 'color=TRUE'. ... plotting commands ... dev.off() usually gives much better-looking plots, and with thicker lines. -- Karl Ove Hufthammer E-mail and Jabber: karl at huftis.org