[R] Adjust lattice graph axis label on final page

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Feb 26 17:36:22 CET 2010


On Fri, Feb 26, 2010 at 6:14 AM, Sebastien Bihorel
<Sebastien.Bihorel at cognigencorp.com> wrote:
> Thanks Deepayan,
>
> This confirms what I thought I should do... One follow-up question about
> your suggested code: is it possible to create a lattice graph object myplot
> and modify the layout just for panel 7 and 8, rather than creating two
> graphs with different layouts?

Sure:

p <- xyplot(y~x|id,as.table=T,data=mydata)
update(p[1:6], layout = c(2, 3))
update(p[7:8], layout = c(2, 1))

-Deepayan

>
> Sebastien
>
> Deepayan Sarkar wrote:
>>
>> On Thu, Feb 25, 2010 at 3:45 AM, Sebastien Bihorel
>> <Sebastien.Bihorel at cognigencorp.com> wrote:
>>
>>>
>>> Dear R-users,
>>>
>>> I was wondering if there was a way to adjust the placement of the axis
>>> titles for the last page of a multi-page lattice plot (see example
>>> below).
>>> Depending on the total number of panels, the placement of these titles
>>> might
>>> look strange on the last page, if the layout is not adjusted (e.g. in
>>> some
>>> template code).
>>>
>>
>> It's not possible to adjust the labels on a per-page basis.
>>
>> It _is_ possible to have the two plots fill up the last page, but that
>> may not be what you want.
>>
>> xyplot(y~x|id,as.table=T,data=mydata,layout=c(2,3))[1:6]
>> xyplot(y~x|id,as.table=T,data=mydata,layout=c(2,1))[7:8]
>>
>> -Deepayan
>>
>



More information about the R-help mailing list