I have plotted a graph using rpy2. I am using Eclipse. When I run the code, the plot just blinks for 1 sec and go away. How do I make the graph to hold on? My code is:
#!/usr/bin/python
import rpy2.robjects as robjects
r = robjects.r
r('x = c(1, 2, 3)')
r('y = c(6, 7, 8)')
r('plot(x, y)')
Terminating an R process closes interactive plotting windows left open… and this is what is happening at the end of your (Python) script.
If you have to keep your Python process alive (since the embedded R depends on it), there are several strategies. The simplest might be to add at the end: