[R] how to automatically maximize the graph window (under XP) ?

pieterprovoost at gmail.com pieterprovoost at gmail.com
Thu Dec 4 14:51:39 CET 2008


Hi,

If you have Python running on your system you could create this script (graphics.py):

import win32api
import win32con
import win32gui
def windowEnumerationHandler(hwnd, windowlist):
    windowlist.append((hwnd, win32gui.GetWindowText(hwnd)))
mywindows = []
win32gui.EnumWindows(windowEnumerationHandler, mywindows)
for hwnd, windowtext in mywindows:
    if windowtext.startswith('R Graphics'):
        win32gui.ShowWindow(hwnd, win32con.SW_MAXIMIZE)  

Then adds this to your R code:

system("python graphics.py")



--
This message was sent on behalf of pieterprovoost at gmail.com at openSubscriber.com
http://www.opensubscriber.com/message/r-help@r-project.org/9516326.html



More information about the R-help mailing list