Forgot to send to the list.


Begin forwarded message:

> From: Saptarshi Guha <saptarshi.guha@gmail.com>
> Date: September 19, 2008 1:43:50 PM GMT-04:00
> To: Gabor Grothendieck <ggrothendieck@gmail.com>
> Subject: Re: [R] Lines between panels in lattice
>
> Certainly.
>
> x=cbind(runif(10),rnorm(10),c(rep(1,5),rep(2,5)))
> xyplot(x[,2]~x[,1]|x[,3],layout=c(1,2))
> x
>
> #x[,3]==2 is in the top panel and x[,3]==1 is in the bottom panel
> #so x[6:,] onwards is on the top panel and x[1:5,] is in the bottom
> #to find out the names of the viewports, use current.vpTree()
>
> seekViewport("plot1.panel.1.2.off.vp")
> grid.move.to(unit(x[10,1],"native"),unit(x[10,2],"native"))
> seekViewport("plot1.panel.1.1.off.vp")
> grid
> .line
> .to
> (unit
> (x[1,1],"native"),unit(x[1,2],"native"),gp=gpar(col='#aaaaaa',lty=3))
>
> Further details can be found in R Graphics, Paul Murrel, page 196  
> (ISBN 1-58488-486-X)
> Hope it helps.
> Regards
> Saptarshi
>
>
>
> On Sep 19, 2008, at 1:32 PM, Gabor Grothendieck wrote:
>
>> Maybe you could post a working solution.
>>
>> On Fri, Sep 19, 2008 at 1:28 PM, Saptarshi Guha
>> <saptarshi.guha@gmail.com> wrote:
>>> Got it. It should be plot1.panel.1.2.off.vp and likewise.
>>> Thanks
>>> Saptarshi
>>>
>>> On Sep 19, 2008, at 12:08 PM, Saptarshi Guha wrote:
>>>
>>>> Hello,
>>>> I have a multi-page display each consisting of two-panels above  
>>>> each
>>>> other.
>>>> I need to draw a line from the top panel to bottom panel. Using
>>>> current.vpTree()
>>>> i find that "plot1.panel.1.2.vp" and "plot1.panel.1.1.vp" are the
>>>> top and bottom ones respectively.
>>>> I am using the following code(inspired by Paul Murrell's R  
>>>> Graphics)
>>>> to draw a line.
>>>> (All the co-ordinates lie well within the ranges of the respective
>>>> panels)
>>>>
>>>> seekViewport("plot1.panel.1.2.vp")
>>>> grid.move.to(unit(0.72,"native"),unit(3.8,"native"))
>>>> seekViewport("plot1.panel.1.1.vp")
>>>> grid.line.to(unit(1.2,"native"),unit(3.5,"native"))
>>>>
>>>> However, I can see the line in the bottom panel, but nothing in the
>>>> top. Is there some
>>>> clipping going on?
>>>>
>>>> Thanks
>>>> Saptarshi
>>>>
>>>> Saptarshi Guha | saptarshi.guha@gmail.com | http://www.stat.purdue.edu/~sguha
>>>>
>>>
>>> Saptarshi Guha | saptarshi.guha@gmail.com | http://www.stat.purdue.edu/~sguha
>>> After years of research, scientists recently reported that there is,
>>> indeed, arroz in Spanish Harlem.
>>>
>>>
>>>      [[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.
>>>
>
> Saptarshi Guha | saptarshi.guha@gmail.com | http://www.stat.purdue.edu/~sguha
> The mome rath isn't born that could outgrabe me.
> 		-- Nicol Williamson
>

Saptarshi Guha | saptarshi.guha@gmail.com | http://www.stat.purdue.edu/~sguha
A fail-safe circuit will destroy others.
		-- Klipstein


	[[alternative HTML version deleted]]

