Skip to content

Problems with example(Grid) in grid package

6 messages · Gabor Grothendieck, Hadley Wickham, Paul Murrell +1 more

#
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:
[1] "R version 2.2.0, 2005-09-20"
#
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.

Hadley
On 10/21/05, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
3 days later
#
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
#
Hi
Gabor Grothendieck wrote:
grid.multipanel() is just a demo hack function, not intended for people 
to use for anything serious, just meant to provide an example of what 
can be done.  It had some merit when grid was just a prototype package 
for people to play with.  Now that grid is more mature I should probably 
just kill grid.multipanel().

Paul
#
On Tue, 25 Oct 2005, Paul Murrell wrote:

            
Because many (maybe even most) png viewers do not handle transparency 
correctly.
#
On 10/24/05, Paul Murrell <p.murrell at auckland.ac.nz> wrote:
If you kill it I still think it would be a nice to provide a similar
example.  I am sorry that I missed knowing about it when initially
trying to learn how to do layouts since it might have saved me some
time.  Maybe it can be incorporated into the example section of one
of the help files or into a demo or even a vignette on grid.multipanel.

Also note that grid.multipanel is used not only in Grid but also in:
  http://www.stat.auckland.ac.nz/~paul/grid/doc/rotated.pdf