2017-06-12 53 views
2

我是新來的使用R.我的朋友通常使用inkscape完成他們的R圖。他們使用RStudio和Inkscape的V0.92,之後便使該地塊在RStudioR複製到inkscape 0.92

Export > Copy to Clipboard > Copy as Metafile > Copy Plot 

然後在Inkscape中簡單地Ctrl + V。但是當我這樣做時,Inkscape中的粘貼情節就完全被破壞了。

我的例子:

在RStudio

data=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25) 
par(pty="s") 
qqnorm(data, pch=19, cex = 0.8, xlab = "Quantis Teóricos", ylab= "Amostra", las=1, 
     main="Gráfico QQ", lwd = 0.25, cex.main=1.0, cex.lab=0.75, cex.axis=0.75, 
     font.lab=2, xlim=c(-5,5), xaxs="r", yaxs="r") 
qqline(data, lwd = 0.25) 
grid(4, 5, lwd = 0.25) 
box(lwd = 0.25) 

Image Here

然後,當我Ctrl + V在Inkscape中,我得到

a little zoom

任何人知道如何解決它???

+0

我非常感謝Inkscape - 偉大的工具! - 但與舊版本0.48相比,新版本對我來說似乎都是一種貶低。粘貼在0.48中運行良好,所以如果可以的話,你可能想要抓住它。 – lukeA

回答

2

參照link;

您不應複製/粘貼到inkspace,而是輸出*.svg以稍後在該環境中對其進行編輯。

mypath <- "Path/to/the/desired/folder/myplot.svg" #Edit the path as you wish 
svg(mypath, width = 8, height = 10) 

data=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25) 
par(pty="s") 
qqnorm(data, pch=19, cex = 0.8, xlab = "Quantis Teóricos", ylab= "Amostra", las=1, 
    main="Gráfico QQ", lwd = 0.25, cex.main=1.0, cex.lab=0.75, cex.axis=0.75, 
    font.lab=2, xlim=c(-5,5), xaxs="r", yaxs="r") 
qqline(data, lwd = 0.25) 
grid(4, 5, lwd = 0.25) 
box(lwd = 0.25) 

dev.off() 

這將爲您提供一個文件,您可以稍後在Inkspace中進行編輯。