输出一个图形到.eps文件与R。

时间:2022-08-21 23:24:55

How do I export a graph to an .eps format file? I typically export my graphs to a .pdf file (using the 'pdf' function), and it works quite well. However, now I have to export to .eps files.

如何将图形导出到.eps格式文件?我通常将我的图导出为.pdf文件(使用“pdf”功能),而且效果很好。但是,现在我必须导出到.eps文件。

5 个解决方案

#1


100  

The easiest way I've found to create postscripts is the following, using the setEPS() command:

我发现创建postscripts的最简单方法是使用setEPS()命令:

setEPS()
postscript("whatever.eps")
plot(rnorm(100), main="Hey Some Data")
dev.off()

#2


40  

If you are using ggplot2 to generate a figure, then a ggsave(file="name.eps") will also work.

如果您正在使用ggplot2生成一个图形,那么一个ggsave(文件="name.eps")也会工作。

#3


28  

The postscript() device allows creation of EPS, but only if you change some of the default values. Read ?postscript for the details.

postscript()设备允许创建EPS,但前提是您更改了一些默认值。详情请参阅postscript。

Here is an example:

这是一个例子:

postscript("foo.eps", horizontal = FALSE, onefile = FALSE, paper = "special")
plot(1:10)
dev.off()

#4


10  

Another way is to use Cairographics-based SVG, PDF and PostScript Graphics Devices. This way you don't need to setEPS()

另一种方法是使用基于cairographicos的SVG、PDF和PostScript图形设备。这样就不需要setEPS()了

cairo_ps("image.eps")
plot(1, 10)
dev.off()

#5


4  

Yes, open a postscript() device with a filename ending in .eps, do your plot(s) and call dev.off().

是的,打开一个postscript()设备,文件名以.eps结尾,执行您的plot(s)并调用dev.off()。

#1


100  

The easiest way I've found to create postscripts is the following, using the setEPS() command:

我发现创建postscripts的最简单方法是使用setEPS()命令:

setEPS()
postscript("whatever.eps")
plot(rnorm(100), main="Hey Some Data")
dev.off()

#2


40  

If you are using ggplot2 to generate a figure, then a ggsave(file="name.eps") will also work.

如果您正在使用ggplot2生成一个图形,那么一个ggsave(文件="name.eps")也会工作。

#3


28  

The postscript() device allows creation of EPS, but only if you change some of the default values. Read ?postscript for the details.

postscript()设备允许创建EPS,但前提是您更改了一些默认值。详情请参阅postscript。

Here is an example:

这是一个例子:

postscript("foo.eps", horizontal = FALSE, onefile = FALSE, paper = "special")
plot(1:10)
dev.off()

#4


10  

Another way is to use Cairographics-based SVG, PDF and PostScript Graphics Devices. This way you don't need to setEPS()

另一种方法是使用基于cairographicos的SVG、PDF和PostScript图形设备。这样就不需要setEPS()了

cairo_ps("image.eps")
plot(1, 10)
dev.off()

#5


4  

Yes, open a postscript() device with a filename ending in .eps, do your plot(s) and call dev.off().

是的,打开一个postscript()设备,文件名以.eps结尾,执行您的plot(s)并调用dev.off()。