使 R Studio 绘图仅显示在新窗口中 [英] Make R Studio plots only show up in new window

查看:188
本文介绍了使 R Studio 绘图仅显示在新窗口中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 R Studio 时,我通常只使用堆叠在控制台顶部的 .R 文件.我将其他窗格(环境、历史、文件等)隐藏起来.

When using R Studio, I usually just work with an .R file stacked on top of the Console. I keep the other panes (Environment, History, Files, etc) hidden.

但是每当我绘制图形时,其他窗格都会自动从侧边栏中弹出以显示绘图窗格.因为我在笔记本电脑上工作,所以一切都太小而无法看到.通过单击绘图"窗格上的 缩放 按钮,我可以让绘图也显示在新窗口中,但不会阻止绘图"窗格显示.

But whenever I plot a graph, the other panes automatically pop out of the side bar to show me the Plot pane. Because I work on a laptop, this makes everything too small to see. By clicking the Zoom button on the Plots pane, I can get the plot also show up in a new window, but does not prevent the Plots pane from showing up.

有没有办法在 R Studio 中禁用"绘图窗格,并在新窗口中显示强制绘图?

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

other attached packages:
[1] ggplot2_2.2.1     jsonlite_1.4     
[3] data.table_1.10.4

loaded via a namespace (and not attached):
 [1] labeling_0.3     colorspace_1.2-6
 [3] scales_0.4.1     lazyeval_0.2.0  
 [5] plyr_1.8.4       tools_3.2.3     
 [7] gtable_0.1.2     tibble_1.3.0    
 [9] curl_2.5         Rcpp_0.12.10    
[11] grid_3.2.3       munsell_0.4.2   
> 

推荐答案

在 RStudio 中,默认图形设备通常是 "RStudioGD".您可以将其更改为其他内容:Windows 上的正常选择是 "windows",MacOS 上的 "quartz",Linux 上的 "X11".例如,使用

In RStudio, the default graphics device is normally "RStudioGD". You can change that to something else: the normal choices are "windows" on Windows, "quartz" on MacOS, "X11" on Linux. So for example, use

options(device = "quartz")

在 Mac 上的 RStudio 会话中,您将获得常规的 MacOS 图形窗口.

in your RStudio session on a Mac and you'll get the regular MacOS graphics window.

这篇关于使 R Studio 绘图仅显示在新窗口中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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