dvanic
dvanic

Reputation: 575

ggplot2 geom_point 50000 points - output to pdf - need to open in Illustrator

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!

Upvotes: 2

Views: 953

Answers (1)

Troy
Troy

Reputation: 8691

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() 

Upvotes: 1

Related Questions