Persp3d freezes when run from within Python

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Persp3d freezes when run from within Python

wchips
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
Reply | Threaded
Open this post in threaded view
|

Re: Persp3d freezes when run from within Python

Duncan Murdoch-2
On 11-12-04 8:57 PM, wchips wrote:
> 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?

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

>
> 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.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Persp3d freezes when run from within Python

wchips
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