[R] Panels order in lattice graphs

Cristina Silva csilva at ipimar.pt
Thu May 5 13:25:44 CEST 2011


Thank you very much.

Cristina

On 05/05/2011 10:44, Deepayan Sarkar wrote:
> On Wed, May 4, 2011 at 9:20 PM, Cristina Silva<csilva at ipimar.pt>  wrote:
>> Hi all,
>>
>> In lattice graphs, panels are drawn from left to right and bottom to top.
>> The flag "as.table=TRUE" changes to left to right and top to bottom. Is
>> there any way to change to first top to bottom and then left to right?
>> didn´t find anything neither in Help pages nor Lattice book.
> See ?packet.panel.default. For example,
>
>
> p<- xyplot(mpg ~ disp | factor(carb), mtcars, as.table = TRUE)
>
> print(p, packet.panel = packet.panel.default)
>
> my.packet.panel<-
>      function(layout, condlevels, page, row, column, ...)
> {
>      tlayout<- layout[c(2, 1, 3)] # switch row and column
>      print(packet.panel.default(tlayout, condlevels, page = page,
>                                 row = column, column = row, ...))
> }
>
> print(p, packet.panel = my.packet.panel)
>
>
> -Deepayan
>


-- 
------------------------------------------
Cristina Silva
INRB/L-IPIMAR
Unidade de Recursos Marinhos e Sustentabilidade
Av. de Brasília, 1449-006 Lisboa
Portugal
Tel.: 351 21 3027096
Fax: 351 21 3015948
csilva at ipimar.pt



More information about the R-help mailing list