Re: [R] Viewport and grid.draw

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Sun, 9 Dec 2007 19:51:12 -0800

On Dec 9, 2007 6:58 PM, Judith Flores <juryef_at_yahoo.com> wrote:
> Hi Deepayan and everyone,
>
> I need to add a common legend to a group of latice
> graphs, I have tried different ways using viewport and
> grid.draw without success.

Try looking at the first example in

http://dsarkar.fhcrc.org/lattice/book/Chapter12-Interaction/edited.R

for inspiration.

-Deepayan

>
> Here is what I have:
>
> plot.new()
>
> library(grid)
> library('IDPmisc')
>
> print(plot1, split=c(1,1,2,4), more=TRUE)
> print(plot4, split=c(2,1,2,4), more=TRUE)
> print(plot2, split=c(1,2,2,4), more=TRUE)
> print(plot5, split=c(2,2,2,4), more=TRUE)
> print(plot3, split=c(1,3,2,4), more=TRUE)
> print(plot6, split=c(1,4,1,4), more=FALSE)
> grid.text(vp=do.call(viewport,grid.locator(unit="npc")),
> label='A', gp=gpar(fontsize=20))
> grid.text(vp=do.call(viewport,grid.locator(unit="npc")),
> label='B', gp=gpar(fontsize=20))
>
>
>
>
>
> key1<-draw.leg(key=list(text=list(c('some text',
> 'text2')),points=list(pch=c(17,15))))
> vp.key<-viewport(grid.locator(unit="npc"))
> pushViewport(vp.key)
> grid.draw(key1)
>
> grid.locator cannot be one of the arguments of
> viewport, but waht would be the analog of this
> argument in viewport then?
>
> Thank you,
>
> Judith
>
>
>
>
> ____________________________________________________________________________________
> Be a better friend, newshound, and
>
> ______________________________________________
> R-help_at_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_at_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. Received on Mon 10 Dec 2007 - 04:02:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Dec 2007 - 09:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.