Rich Shepard
2015-Jul-02 14:46 UTC
[R] Lattice: set col = "black" for box.rectangle and box.umbrella
Lattice's bwplot() displays and prints (using pdf()) the box.rectangle and box.umbrella in a pale blue that is a pale gray on b&w laser printer output. I would like to set default options so the box and whiskers are displayed and printed in black by modifying ~/.Rprofile by adding a .First() function. Reading Chapter 7 in Deepayan's book and the ?Startup man page did not result in my understanding the correct syntax for lattice.options(default.args = list(...)) in ~/.Rprofile. Web searches did not find guidance, either. Would appreciate help on learning how to set these options so they are effective when R is invoked. Rich
David Winsemius
2015-Jul-02 16:25 UTC
[R] Lattice: set col = "black" for box.rectangle and box.umbrella
On Jul 2, 2015, at 7:46 AM, Rich Shepard wrote:> Lattice's bwplot() displays and prints (using pdf()) the box.rectangle and > box.umbrella in a pale blue that is a pale gray on b&w laser printer output. > I would like to set default options so the box and whiskers are displayed > and printed in black by modifying ~/.Rprofile by adding a .First() function. > > Reading Chapter 7 in Deepayan's book and the ?Startup man page did not > result in my understanding the correct syntax for > lattice.options(default.args = list(...)) in ~/.Rprofile. Web searches did > not find guidance, either. > > Would appreciate help on learning how to set these options so they are > effective when R is invoked.The lead-in to section 7.2 mentions `trellis.par.get`, but in order to change anything you need to use `trellis.par.set` as was illustrated in the pages leading up to that section: trellis.par.set(box.umbrella=list(col="black")) bwplot(decrease ~ treatment, OrchardSprays) trellis.par.set(box.rectangle=list(col="black")) bwplot(decrease ~ treatment, OrchardSprays) Could do it all at once with: trellis.par.set(list( box.umbrella=list(col="black"), box.rectangle=list(col="black") ) And Sarkar mentions that this form can be used to create a theme. You may want to investigate the function `standard.theme` and read section 7.1.4 of that chapter again. -- David Winsemius Alameda, CA, USA
Rich Shepard
2015-Jul-02 16:57 UTC
[R] Lattice: set col = "black" for box.rectangle and box.umbrella
On Thu, 2 Jul 2015, David Winsemius wrote:> The lead-in to section 7.2 mentions `trellis.par.get`, but in order to > change anything you need to use `trellis.par.set` as was illustrated in > the pages leading up to that section:David, I saw `trellis.par.set` but did not know how to use that in ~/.Rprofile.> > trellis.par.set(box.umbrella=list(col="black")) > bwplot(decrease ~ treatment, OrchardSprays) > trellis.par.set(box.rectangle=list(col="black")) > bwplot(decrease ~ treatment, OrchardSprays) > > Could do it all at once with: > > trellis.par.set(list( > box.umbrella=list(col="black"), > box.rectangle=list(col="black") > ) > > And Sarkar mentions that this form can be used to create a theme. You may > want to investigate the function `standard.theme` and read section 7.1.4 > of that chapter again.Yes. Modifying the standard.theme would do the job, too. Many thanks, Rich