Skip to content
Prev 277191 / 398506 Next

dev.new() within a loop

On Nov 13, 2011, at 9:35 AM, Giovanni Azua wrote:

            
I told you which FAQ to read. It's only a few sentences. And it very  
specifically and I think clearly covers the problem you asked about. I  
do not know why you had to google it if you really did read that  
particular FAQ.
That is true when you are using grid-based graphic. It is going to  
return a NULL in the case of base graphics calls.

This is the function:

 > print.ggplot
function (x, newpage = is.null(vp), vp = NULL, ...)
{
     set_last_plot(x)
     if (newpage)
         grid.newpage()
     if (is.null(vp)) {
         grid.draw(ggplotGrob(x, ...))
     }
     else {
         if (is.character(vp))
             seekViewport(vp)
         else pushViewport(vp)
         grid.draw(ggplotGrob(x, ...))
         upViewport()
     }
}
<environment: namespace:ggplot2>