简体   繁体   English

如何在Linux中打开R图形窗口?

[英]How to open R graphic window in linux.?

When running an R script in Windows, the command windows() opens an annex windows to plot the graphs. 在Windows中运行R脚本时,命令windows()将打开一个附件窗口以绘制图形。 This is very handy when running simulations with several time steps. 当运行具有多个时间步长的仿真时,这非常方便。

But I moved to Linux and I want to do the same when running from then terminal with the command Rscript. 但是我转而使用Linux,并且在从终端运行Rscript命令时希望这样做。 I tried replacing windows() with dev.new() but the only results is a pdf with the series of graphs. 我尝试用dev.new()替换windows(),但是唯一的结果是带有一系列图形的pdf。 I just want to see the graph, but not store it. 我只想查看图形,但不存储它。

Is there another approach? 还有其他方法吗?

As comments also mentioned, you can use 正如评论还提到的,您可以使用

 X11(display = "", width, height, pointsize, gamma, bg, canvas, fonts, family, xpos, ypos, title, type, antialias)

for example following would lead to a 10x10 inches square plot 例如,以下将导致10x10英寸的方形图

 X11(width=10, height=10)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM