I'm currently using the get_map function from package ggmap to grab a google map, I then use ggmap and annotate to add points to the plot. For each call to annotate there is roughly 1000 points being added, and I call annotate around 100 times. After saving the output to pdf the rendering and subsequent interaction with the pdf is very slow. Is there a good way to save to pdf from the quartz or X11 device that will have the same resolution but render faster? And/Or is there a way of using ggmap to create efficient maps?
Asked
Active
Viewed 765 times
1
-
Can you clarify whether its (a) saving the plot from R to disc, or (b) viewing the resulting PDF file in a viewer, that is slower than you'd like? – joran May 30 '12 at 23:30
-
1possible duplicate of [Reduce pdf file size of plot in R](http://stackoverflow.com/questions/8521299/reduce-pdf-file-size-of-plot-in-r). See @hadley's answer. – Ari B. Friedman May 30 '12 at 23:43
-
also see http://stackoverflow.com/questions/8364288/what-hardware-limits-plotting-speed-in-r – David LeBauer May 31 '12 at 00:43
-
@joran they are both fairly slow, but I'm more concerned about viewing in pdf. – csta May 31 '12 at 12:47
-
Ok, if viewing the resulting file is the primary problem, then I think your only options are to either make pdfs with fewer elements (fewer points) or get a computer with more RAM/faster processor, etc. Though as others noted, compression will also help, by reducing the file size. – joran May 31 '12 at 12:52