RStudio:以编程方式获取绘图缩放窗口的大小

4

grDevices::dev.size()可以以编程方式提供RStudio Viewer窗格的大小。

是否有类似的命令(或者甚至是技巧)可以以编程方式获取Zoom窗口的大小?在rstudioapi命令的简要搜索中似乎没有提供任何线索。


可能仍然不可能(https://dev59.com/ZoDba4cB1Zd3GeqPCU3L) - Roman
1个回答

0

我已经很久没有遇到类似的问题了。你找到答案了吗?

我采用了这个解决方案:

从窗口开始

}

x11() # open new window
boxplot(rnorm(100)) # wrtie some good box full of normal values. 
#Plot it! You will see it on the new screen. 
#Now, let's make this loop, and everything will appear. 
while(TRUE){
    cdev <- grDevices::dev.size("cm")
    Sys.sleep(0.5)
    cat("Width (cm):", cdev[1], "High (cm):", cdev[2], "\r")
    cat("Press escape to break it.")
}
#Change the new windows number size, and those new numbers will flow. 


对不起,我有点搞砸了。它当然可以工作,但答案应该更简洁。我们可以说,现在是睡觉的时间了。 - Mateusz Kania

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接