Once you load

library(grid)

the rest works. Nice job :)

Dennis

On Sat, Aug 21, 2010 at 1:15 PM, baptiste auguie <
baptiste.aug...@googlemail.com> wrote:

> Hi,
>
>
> I think you could do it quite easily with lattice,
>
> library(lattice)
>
> latticeGrob <- function(p, ...){
>   grob(p=p, ..., cl="lattice")
> }
> drawDetails.lattice <- function(x, recording=FALSE){
>   lattice:::plot.trellis(x$p, newpage=FALSE)
> }
>
> plots <- replicate(4, xyplot(rnorm(10)~rnorm(10),xlab="",ylab=""),
> simplify=F)
>
> my.vp <- function(x,y)
> viewport(x=x,y=y,default.units="native",width=unit(1, "cm"),
> height=unit(1,"cm"))
>
> my.panel = function(x, y, ...){
>  ind <- seq_along(x)
>  for (ii in ind){
>    g <- latticeGrob(plots[[ii]], vp=my.vp(x[ii],y[ii]))
>    grid.draw(g)
>  }
> }
>
> xyplot(1:4~1:4, panel = my.panel)
>
> HTH,
>
> baptiste
>
> On 21 August 2010 22:11, Barry Rowlingson <b.rowling...@lancaster.ac.uk>
> wrote:
> > On Sat, Aug 21, 2010 at 8:48 PM, r.ookie <r.oo...@live.com> wrote:
> >> I'm trying to understand your question because when I think of a graph,
> I think of one canvas, on which, various functions are plotted (a function
> can be one point for example).
> >>
> >> So, when you say each 'element' do you mean each function?
> >> If so, then that seems to be asking how to plot a function per graph
> (which is probably obvious and not what you're asking)
> >>
> >> How about you clarify first :)
> >>
> >
> >  Sounded to me a bit like plotting pie charts at the locations of
> > countries on a map. Or something better (not hard).
> >
> >  subplot from Hmisc?
> >
> >  library(Hmisc)
> >  example(subplot)
> >
> > Barry
> >
> > ______________________________________________
> > R-help@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.
> >
>
> ______________________________________________
> R-help@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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to