How to change current Plot Window Size (in R)

后端 未结 2 804
时光取名叫无心
时光取名叫无心 2020-12-05 19:09

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 wan

2条回答
  •  佛祖请我去吃肉
    2020-12-05 19:30

    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))
    

提交回复
热议问题