Hi Laurent, 

 

Thanks for the link describing how to update the R graphics window. 

 

I modified my original script to the following: 

 

###########################

import rpy2.robjects as robjects
import rpy2.rinterface as rinterface
import time
import threading

 

def refresh():
    # Ctrl-C to interrupt
    while True:
        rinterface.process_revents()
        time.sleep(0.1)
        
rinterface.initr()
t = threading.Timer(0.1, refresh)
t.start()
r = robjects.r
m = r.matrix(r.rnorm(100), ncol=5)
pca = r.princomp(m)
r.plot(pca, main="Eigen values")

############################

 

 

Unfortunately I still get the same errors. The graphics window is fine when I 
run the script from IDle 

but fails from the command line and when I execute via double clicking the 
script file. 

 

Am I doing something wrong?

I have tried to search for examples which use the "process_revents" but with no 
luck. 

 

I have also tried this on Vista and get the same problem. 

 

Any help would be appreciated. 

 

Regards, 

Wayne


 
> Date: Tue, 21 Jul 2009 18:45:27 +0200
> From: lgaut...@gmail.com
> To: dy...@jhmi.edu; wayne_be...@hotmail.com
> CC: rpy-list@lists.sourceforge.net
> Subject: Re: [Rpy] RPy2 win xp R plotting
> 
> http://rpy.sourceforge.net/rpy2/doc/html/rinterface.html?highlight=even#graphical-devices
> 
> 
> Daniel Yuan wrote:
> > On Jul 21, 2009, at 11:45 AM, wayne jones wrote:
> > 
> >> However if I run this script line by line in the python terminal 
> >> window then 
> >> the graphics appears but no graph is displayed and when I try to move 
> >> or resize the 
> >> plot it fails and eventually crashes Python. 
> > 
> > Perhaps this is a clue: On Mac OS X the plot is successful, but I cannot 
> > close the X11 window manually in the way that I can running the R code 
> > directly in the R interpreter. (The window closes fine using 
> > "r('dev.off()')".)
> > 
> > - Daniel
> > 
> > Mac OS X 10.5.7
> > R 2.8.0
> > rpy2 2.1.0-dev 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > ------------------------------------------------------------------------------
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > rpy-list mailing list
> > rpy-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/rpy-list
> 

_________________________________________________________________
Windows Live Messenger: Happy 10-Year Anniversary—get free winks and emoticons.
http://clk.atdmt.com/UKM/go/157562755/direct/01/
------------------------------------------------------------------------------
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to