[R] X11 graphics windows under CMD BATCH

Luke Spadavecchia l.spadavecchia at googlemail.com
Sun Oct 28 15:30:44 CET 2007

Hi Dirk,

Thanks for your useful advice, although I am not sure I fully  
understand your response.

I am able to open x11 windows from R CMD BATCH both in windows  
XP,MAC  OS X and Linux (on various machines I use), providing the  
relevant Sys.setenv() commands are in the script I call prior to  
plotting commands. My problem is that the X11 windows only persist as  
long as the script is running, and disappear when R exits - which is  
very rapid for most plots (it is only when the script imports a  
shapefile using maptools or something like that that the window is  
open long enough to really examine the plot).

Is there a way when running R (from batch mode or otherwise) of  
'saving' X11 windows, and keeping them open after the R session is  
complete? I don't really want to write the graphics to file, because  
the repeated calls from the Fortran code would overwrite each other,  
and the idea is to do rapid appraisal of the simulated annealing  
schedule, to check that mixing/cooling are progressing in an  
efficient and  useful manner. Would using cairo (which I can't seem  
to get to work at the moment) allow me to do this? I'm not sure it's  
an x11 problem, but rather something to do with the way that R and  
X11 communicate?

Many thanks

Luke Spadavecchia

More information about the R-help mailing list