Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in R Programming by (7.3k points)

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.

1 Answer

0 votes
by

To save a graph to an eps file, you can use the setEPS() function as follows:

setEPS()

postscript("whatever.eps")

plot(rnorm(100), main="Hey Some Data")

dev.off()

In ggplot2, you can use the ggsave() function as follows:

ggsave(file="name.eps")

The eps file will be saved in your current working directory.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...