Re: [R] help: how to change the size of a window after it has been created

From: Marc Schwartz <MSchwartz_at_mn.rr.com>
Date: Thu 14 Jul 2005 - 23:12:18 EST

On Thu, 2005-07-14 at 14:38 +0200, wu sz wrote:
> Hello,
>
> I wish to plot some figures in a window in turn, but the size of these
> figures is different, so how can I change the size of the window by
> resetting the parameters before each plotting?
>
> Thank you,
> Shengzhe

Other than dragging a plot window with a mouse, I do not think that there is a way to change the size of an open display device via code (though somebody will no doubt correct me if I am wrong).

See ?Devices

Depending upon your OS, there is likely a 'width' and 'height' argument for the screen display device for newly opened devices.

For example, under systems using X, where X11() is the screen device:

X11(width = 11, height = 8)
plot(1:10)

X11(width = 5, height = 5)
barplot(1:5)

In the above example, two separate plot windows will be created.

If you want to only have one open at a time, you can close the device first using dev.off() before the subsequent plots. However, you lose the current plot as soon as you close it.

X11(width = 11, height = 8)
plot(1:10)
dev.off()

X11(width = 5, height = 5)
barplot(1:5)
dev.off()

HTH, Marc Schwartz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 14 23:15:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:40 EST