forcing R PDF to new page after variable number of plots -


i can have or odd number of plots on each page, depending on input data size/shape.

i set par(mfrow) values such smallest grid possible hold of plots, want make sure moves next page on next loop iteration in case total number of plots ends odd or not fit grid.

how can force new page? google has shown me grid.newpage(), error

> grid.newpage() error: not find function "grid.newpage" 

when try use it. also, unless mistaken, base plotting not use grid anyways wouldn't me.

here's suggested strategy: fill empty cells plot.new() until layout filled; next plot automatically push new page.

n = 5 rc = n2mfrow(n) par(mfrow=rc, mar=c(0,0,0,0))  for(ii in seq_len(n))     plot(rnorm(10)) for(ii in seq_len(prod(rc) - n))     plot.new()  plot(1,1) # on own new page 

alternatively, try

while(!par('page')) plot.new() 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -