Skip to content

dev.new() within a loop

2 messages · Giovanni Azua, David Winsemius

#
On Nov 13, 2011, at 3:23 PM, David Winsemius wrote:
It is not resistance, the FAQ is very helpful for basic general questions but it can not cover all details. Sometimes it is very hard to find a specific detailed answer within a general FAQ. I have read the FAQ, what makes you think I didn't before? I just could not find the information I was looking for.
Ok bottom line is always wrap the plot call whatever it is within a print for the just in case.

Cheers,
Giovanni
#
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>