Skip to content

Persp3d freezes when run from within Python

3 messages · wchips, Duncan Murdoch

#
G'day everyone,

I've been trying to get an interactive OpenGL plot to work from within
Python 2.6 using Rpy2 and the persp3d function. The problem is that the plot
seems to freeze upon activation. All interactivity is lost even though it
works fine when run from within the R console (version 2.11.1). Is this a
known issue? Any ideas as to what might be causing this, or possibly how to
fix it?

cheers,
wchips

--
View this message in context: http://r.789695.n4.nabble.com/Persp3d-freezes-when-run-from-within-Python-tp4158940p4158940.html
Sent from the R help mailing list archive at Nabble.com.
#
On 11-12-04 8:57 PM, wchips wrote:
Presumably your Python program or Rpy2 is not simulating the event 
handling that the real R console does.  Solution:  use the real R 
console, or fix the bug in your program or Rpy2.

Duncan Murdoch
#
Thanks Duncan. The thing is, if you want to display a static R graph using
Rpy2 you need to bring your Python program to a halt immediately after
printing the graph to screen using something like:

raw_input("Press any key to continue ...")

, otherwise it flashes up on the screen for a fraction of a second and then
disappears. I assume this is one and the same issue.. That being, that R is
somehow opened and then _closed_ after each instruction when using Rpy2. So
whilst "pausing" Python might give you a "snapshot" of the 3d graph, it
doesn't give you dynamic interactivity. I just need to find a way to keep R
running in the background when I execute that command.

Again, if anyone has had the same problem throw me a line! Or other
suggestions are also welcome.

cheers,
chips

--
View this message in context: http://r.789695.n4.nabble.com/Persp3d-freezes-when-run-from-within-Python-tp4158940p4162766.html
Sent from the R help mailing list archive at Nabble.com.