plotting R graphics with rpy: figure crashes

Frank supervau at gmail.com
Tue Mar 27 23:09:54 CEST 2007


Hi,

I use rpy to plot functions and have the following problem. When I
execute the following code line by line (start python and then execute
line by line) the resulting figure looks as it should. However, when I
put these lines in a script and execute the script the figure appears
for half a second but then crashes. Using pylab.show() at the end of
the script prevents the crash but now the window is no longer
refreshed (e.g., changing the size of the window makes the contents
disappear).

import pylab
import rpy

x = range(0, 10)
y = [ 2*i for i in x ]
rpy.r.plot(x,y)

I compared already with sys.version if the python version is the same
in both cases (it is).  Hence, the problem might be caused by rpy.

Has anyone an idea how to figure that out?

Thanks!

Frank




More information about the Python-list mailing list