views:

1859

answers:

1

For example. Assume I do:

dev.new(width=5, height=4)
plot(1:20)

And now I wish to do

plot(1:40)

But I want a bigger window for it.

I would guess that the way to do it would be (assuming I don't want to open a new window) to do

plot(1:40, width=10, height=4)

Which of course doesn't work.

The only solution I see to it would be to turn off the window and start a new one. (Which will end my plotting history)

Is there a better way ?

Thanks.

A: 

Here is a my solution to this:

resize.win <- function(Width=6, Height=6)
{
        # works for windows
    dev.off(); # dev.new(width=6, height=6)
    windows(record=TRUE, width=Width, height=Height)
}
resize.win(5,5)
plot(rnorm(100))
resize.win(10,10)
plot(rnorm(100))
Tal Galili
That would be 'works only for Windows'. No other system has a function `windows` as Brian Ripley tried to explain to you.
Dirk Eddelbuettel
Hi Dirk,Thanks for mentioning this (also notice I wrote it in the code).But I guess this is something too...Best,Tal
Tal Galili