Set the grid.layout programmatically?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Set the grid.layout programmatically?

Felipe Carrillo
Hello all:
Does anyone know if the grid layout function can be
set dynamically? For example if I have a column that
will be changing as new data is added monthly I would
like grid to detect the new data and create another
row or column for the new plot on the same window
instead of adding the new layout manually. The code
below shows a grid.layout of hardcoded two rows and
two columns.Thanks

pushViewport(viewport(layout=grid.layout(2,2)))

Felipe D. Carrillo
  Fishery Biologist
  US Fish & Wildlife Service
  California, USA

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Set the grid.layout programmatically?

Paul Murrell
Hi


Felipe Carrillo wrote:

> Hello all:
> Does anyone know if the grid layout function can be
> set dynamically? For example if I have a column that
> will be changing as new data is added monthly I would
> like grid to detect the new data and create another
> row or column for the new plot on the same window
> instead of adding the new layout manually. The code
> below shows a grid.layout of hardcoded two rows and
> two columns.Thanks
>
> pushViewport(viewport(layout=grid.layout(2,2)))


Take a look at grid.frame()

Paul


> Felipe D. Carrillo
>   Fishery Biologist
>   US Fish & Wildlife Service
>   California, USA
>
> ______________________________________________
> [hidden email] 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.

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[hidden email]
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
[hidden email] 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.