title: R ggplot2 SVG poor image quality
body: <p>I'm creating a plot with ggplot2 in R. I'm using facet_wrap and the output contains around 50 panels.</p>
  
  <p>Obviously, it's a lot of detail in a single image, so tickmark labels become unreadable in standard output. In my head, the way around that ought to be to export as SVG and figure out how to zoom in. However, the exported SVG file is huge and the quality of the displayed image is low making all details blurry.</p>
  
  <p>If SVG is the way forward, how do I improve the image quality?</p>
  
  <p>What should I be using instead of SVG to keep the file size small?</p>
  
  <p>Thanks.</p>
  
  <p>R version 3.2.0 (2015-04-16)
  Chromium    43.0.2357.81 (Developer Build)
  Ubuntu 14.04 (64-bit))</p>
  
  <p>As requested, some sample code</p>
  
  <pre><code># Generate some data
  id &lt;- paste("Subject", rep(c(letters, LETTERS), each=7*8))
  evt &lt;- rep(paste("Event", 1:8), length.out=length(id))
  days &lt;- rep(rep(1:7, each=7), length.out=length(id))
  value &lt;- sample(c("Yes", "No"), size=length(id), replace=TRUE)
  end &lt;- sample(4:6, size=length(id), replace=TRUE)
  
  d &lt;- data.frame(id=id, evt=evt, days=days, value=value, end=end)
  d$nevt &lt;- as.numeric(d$evt)
  
  # Do plot
  ggplot(d, aes(days, nevt, colour=value)) + # call to geom_rect is lousy, I know
    geom_rect(data=d, aes(xmin=2, xmax=end, ymin=-Inf, ymax=Inf),
              alpha=.01, fill="goldenrod1", color=NA) +
    geom_point(size=2, shape=15, alpha=.8) +
    facet_wrap(~id) +
    scale_y_continuous("", breaks=d$nevt, labels=d$evt) +
    theme(legend.position="none")
  </code></pre>
  
  <p>In case it's of interest, each subject is a patient in a clinical trial. They get treated from day 2 to 6 (the coloured background region), they have or do not have events 1 to 8 on each day, represented by the different coloured points.</p>
  
  <p>Thanks, again.</p>