Bugs item #1944503, was opened at 2008-04-17 10:13 Message generated for change (Comment added) made by juneaftn You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1944503&group_id=48422
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Win32 Group: rpy Status: Open Resolution: Postponed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: R plots are partially blank Initial Comment: I have just installed R 2.6.2, Rpy 1.02 and the PyWin32 package, and reliably experience the following problem when driving R from Python - if I create a plot in R, the portion of the plot window that lies under the IDLE window in which I type my Python code remains blank. So if I type >>> from rpy import * >>> x = range(10) >>> y = [i ** 2 for i in x] >>> r.plot(x,y) I get a plot of y vs. x, but only the top right portion of the plot shows any points, axes etc. The bottom left corner (the portion that lay under the IDLE window) is blank. ---------------------------------------------------------------------- Comment By: June Kim (juneaftn) Date: 2009-01-25 03:35 Message: I should've added that you have to save the return value of win32api.LoadLibrary( Rlib ) from rinterface/__init__.py somewhere(in my example rlib_) in the global in order to access the handle of R.dll. ---------------------------------------------------------------------- Comment By: lgautier (lgautier) Date: 2009-01-25 02:42 Message: The default R_ProcessEvents appears to be somewhat different according to platforms. Calling it does not not on work on Linux/ MacOS X (being the systems I have at hand presently). Looking at R's gnuwin32/system.c, doevent() seems likely to be what is triggering a refresh on win32. It is called by R_ProcessEvent only on win32. (I am tempted to close this, as the bug report is on win32 and June Kim proposes a workaround on that platform). ---------------------------------------------------------------------- Comment By: June Kim (juneaftn) Date: 2009-01-25 02:21 Message: You have to calling R_ProcessEvents repeatedly. Looking at the following python session: >>> import rpy2.robjects as ro >>> import rpy2.rinterface as ri >>> import win32api >>> win32api.GetProcAddress(ri.rlib_,"R_ProcessEvents") 1819439648 >>> rpe=_ >>> import ctypes >>> from _ctypes import call_function >>> import time >>> ro.r.plot([1,2,3,4],[1,2,3,4]) <RObject - Python:0x00D14B48 / R:0x00EA24A0> >>> for i in xrange(10000): ... time.sleep(1) ... call_function(rpe,()) #from now on the plot window is fully responsive. ... ---------------------------------------------------------------------- Comment By: lgautier (lgautier) Date: 2009-01-24 23:05 Message: To juneaftn: I just added a wrapper to R_ProcessEvents, but this does not seem to help (you can check by yourself, it's in the Mercurial repository. ---------------------------------------------------------------------- Comment By: June Kim (juneaftn) Date: 2009-01-24 20:41 Message: I think you have to call "R_ProcessEvents" while the plot window is shown (therefore, provide it as an API call from python). ---------------------------------------------------------------------- Comment By: lgautier (lgautier) Date: 2009-01-24 19:41 Message: The root of the issue seems to be that the refresh of interactive plots is currently not properly handled (neither by rpy or rpy2). There is something planned to address the issue, but in the meanwhile you may want to plot your graphics to a pdf file and have PDF viewer opened on the side. ---------------------------------------------------------------------- Comment By: Michael Hoffman (hoffmanm) Date: 2009-01-22 09:40 Message: I should say that I am using rpy2 2.0.1 and R 2.8.1. ---------------------------------------------------------------------- Comment By: Michael Hoffman (hoffmanm) Date: 2009-01-22 09:40 Message: I have a similar problem (lack of redraw) using X11 under Linux. ---------------------------------------------------------------------- Comment By: lgautier (lgautier) Date: 2008-04-30 11:20 Message: Logged In: YES user_id=1623918 Originator: NO There have been on and off problems with interactive graphic devices (the C stack infamous problem, for example). R-2.7 is introducing changes (improvements) with them, and although they are mostly for X11 and Quartz devices (so UNIX and MacOS X) it could be worth trying what is happening with that version of R. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1944503&group_id=48422 ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list