问题描述
我在Ubuntu上使用最新的R。在我创建了一些
图,光标变成一个+,不会让我访问
复制和粘贴选项。此外,不像Windows中的R,它
没有一个工具栏有'复制'选项。
在Linux下使用R时的默认图形设备是X11:基本上,它创建了一个窗口,您可以在其中看到您的绘图。
这是一个非常基本的窗口没有许多功能,所以答案是:你不能从它复制/粘贴。相反,您需要创建一个不同的图形设备,并写入绘图。大多数人会选择像PNG文件,像这样:
png(file =myplot.png)#create PNG设备
plot(x)#做绘图
dev.off()#返回默认设备(X11)
现在您在当前目录中有一个名为myplot.png的PNG文件。
I am working on the most recent of R on Ubuntu. After I created someplots, the cursor became a '+' and won't let me access thecopy and paste options. Moreover unlike the R in Windows, it doesnot have a toolbar that have the 'Copy' option. What can I do tocopy my plots?
Thank you.
The default graphics device when using R under Linux is something called "X11": basically, it creates the window in which you see your plot.
It's a very basic window without many features so the answer is: you can't copy/paste from it. Instead, you need to create a different graphics device and write the plot to it. Most people would choose something like a PNG file, like this:
png(file = "myplot.png") # create PNG device
plot(x) # do the plot
dev.off() # return to default device (X11)
And you now have a PNG file named "myplot.png" in the current directory.
这篇关于如何在R中工作在Ubuntu中复制图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!