library(ggplot2) # Generate some data data <- data.frame(x=1:10, y=runif(10), group=c(rep("A", 5), rep("B", 5))) # Create a simple plot g <- ggplot(data, aes(x=x, y=y, color=group)) + geom_line() # Set defaults for postscript when outputting EPS files setEPS() # Set the file name and dimensions postscript("crash-evince.eps", height=6, width=9.5) # Generate the plot print(g) # Close the device and write the output file dev.off()