如何更改当前绘图窗口大小(在 R 中) [英] How to change current Plot Window Size (in R)

查看:22
本文介绍了如何更改当前绘图窗口大小(在 R 中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如.假设我这样做:

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

现在我想做

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)

这当然行不通.

我看到的唯一解决方案是关闭窗口并重新打开一个窗口.(这将结束我的阴谋历史)

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)

有没有更好的方法?

谢谢.

推荐答案

这是我的解决方案:

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

这篇关于如何更改当前绘图窗口大小(在 R 中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆