title: How to print a large plot to a small file from R on NetBSD?
body: <p>I am using ggplot2 to plot a relatively large dataset on a remote server (NetBSD), because my local machine does not have sufficient memory for the job. The method I have used successfully to save smaller datasets on my local machine is not working on the remote server. Here's what I want to do:</p>
  
  <pre><code>ggsave(filename="myplot.png", plot=p)
  </code></pre>
  
  <p>The trouble is that when I try to do this on the server, it pops open an X11 window and I get warning messages about X not supporting transparency, along with an empty plot.</p>
  
  <p>I can save the plot as a pdf, but the file size ends up being in the hundreds of megabytes, presumably because the pdf is preserving each of millions of semi-transparent points in the plot. So, given that I need to use transparency to deal with over-plotting, how can I save the plot as an image file not bigger than a couple MB?</p>