Question

I need to plot 50000 points on a single scatterplot using ggplot2 that I then need to be able to open in Illustrator in vector format (making figures for a paper).

There is no better way to display my data than a scatterplot, and I need to be able to show the individual points.

At the moment, I am outputting to pdf. The problem is that while I can open the file in Adobe Acrobat and Mac Preview, Illustrator hangs when "Reading PDF file", probably because there are just too many points for it to handle.

Should I be outputting to a different graphics device? Or is there a way I can use Acrobat Pro to selectively merge some of the data into layers or common paths to enable Illustrator to open the file?

Thanks in advance!

Was it helpful?

Solution

Have you tried svg():

x<-runif(50000)
y<-runif(50000)

qplot(x,y,alpha=0.1)

svg("x.svg")
qplot(x,y,alpha=0.1)
dev.off() 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top