From p.murrell at auckland.ac.nz  Mon Oct 24 22:22:48 2005
From: p.murrell at auckland.ac.nz (Paul Murrell)
Date: Tue, 25 Oct 2005 09:22:48 +1300
Subject: [Rd] Problems with example(Grid) in grid package
References: <971536df0510210719m535de052s4ea9d5737ccf4119@mail.gmail.com>
	<f8e6ff050510211003g29cb94a6o13fe5e33fe0a1335@mail.gmail.com>
Message-ID: <435D4298.8030703@stat.auckland.ac.nz>

Hi


hadley wickham wrote:
 > I've also noticed the behaviour of grid.rect() has changed in 2.2.0.
 > Before the fill defaulted to transparent, but now it defaults to
 > white.


The initial value of the 'gp' settings for the ROOT grid viewport has 
changed in 2.2.0 (see grid/doc/changes.txt).  Before it defaulted to 
transparent, but now it defaults to whatever the 'bg' is for the current 
device (on some, e.g., png() this is "white", though I'm not sure why 
right now) so on some devices something like grid.rect() behaves 
differently.

If before you had something like ...

   <draw, draw, draw ...>
   # Now I think I'll draw a nice border around the outside
   grid.rect()

... you should either do ...

   # I'll draw a rectangle first in case there is a non-transparent
   # fill in effect;  NOTE that if I was writing perfect grid code
   # I would always be aware that I might be being drawn in a viewport
   # that was defined by someone else who might have, for example,
   # defined a non-transparent fill, so it's not entirely
   # grid's fault that things suddenly aren't working as I planned
   grid.rect()
   <draw, draw, draw ...>

... or ...

   <draw, draw, draw ...>
   # Now I think I'll draw a nice border around the outside
   # AND I really want JUST the border;  I have absolutely no
   # intention of filling this rectangle, no matter what the
   # current fill setting happens to be
   grid.rect(gp=gpar(fill="transparent"))
	
Paul


 > On 10/21/05, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
 >
 >>The following:
 >>
 >>library(grid)
 >>grid.newpage()
 >>example(Grid)
 >>
 >>has the yaxis label partly cut off and the x axis label does not 
appear at all.
 >>Also ?grid.multipanel in that example brings up documentation for
 >>grid-internal but this would not seem to be internal if its part of 
an example.
 >>
 >>I am using:
 >>
 >>
 >>>R.version.string  # Windows XP
 >>
 >>[1] "R version 2.2.0, 2005-09-20"
 >>
 >>______________________________________________
 >>R-devel at r-project.org mailing list
 >>https://stat.ethz.ch/mailman/listinfo/r-devel
 >>
 >
 >
 > ______________________________________________
 > R-devel at r-project.org mailing list
 > https://stat.ethz.ch/mailman/listinfo/r-devel


-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/



[Rd] Problems with example(Grid) in grid package
Paul Murrell