Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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
edited 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.

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...