title: How to decrease file size of exported plots while keeping labels sharp
body: <p>When exporting rather complicated plots (especially <code>ListDensityPlot</code>) as a PDF or EPS (for publication, for example), the resulting file size can be quite large. For example:</p>
  
  <pre><code>data = Flatten[Table[{f0, f, Exp[-(f - f0)^2/25^2]}, {f0, 500, 700, 5}, {f, 300, 
   900}], 1];
  plot=ListDensityPlot[data,PlotRange-&gt;{Automatic,Automatic,{0,1}},InterpolationOrder-&gt;0]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ovvEl.png" alt="Mathematica graphics"></p>
  
  <p>This example data set is on the order of the size I typically work with. When I export using <code>Export["C:\\test.pdf", plot]</code>, it generates a PDF file 23.9MB in size. If I instead try <code>Export["C:\\test1.pdf", Rasterize[plot]]</code> it is far smaller, but the integrity and rescalability of the image naturally suffers.</p>
  
  <p>This is complicated further if my actual figure is a combined plot, such as (<em>Edit</em>: <code>f</code> goes to 900)</p>
  
  <pre><code>plot2 = Show[plot, Plot[x, {x, 500, 900}, PlotStyle -&gt; Thick]]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Lzn7D.png" alt="Mathematica graphics"></p>
  
  <p>(or with some usage of <code>Epilog</code>) where I'd love to have the background <code>ListDensityPlot</code> be rasterized, but keep the other markup and plots in ``vector'' form. Or at the very least, the frame labels be non-rasterized.</p>
  
  <p>Is there any way to do this?</p>
  
  <p>Or, to accomplish the same goal via some other clever method?</p>
  
  <hr>
  
  <h3>Update</h3>
  
  <p>I've checked out the related question, but that's gotta be way more complicated than it needs to be (essentially exporting then importing). I've been able to utilize some of the tricks in that question to extract the plot separately from the axes:</p>
  
  <pre><code>axes = Graphics[{}, Options[plot2]]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/RQEsz.png" alt="Mathematica graphics"></p>
  
  <pre><code>plots = Graphics[plot2[[1]]]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/MpwvQ.png" alt="Mathematica graphics"></p>
  
  <p>But, the <code>plots</code> term loses the <code>AspectRatio</code> and <code>PlotRange</code>, etc. <code>plots</code> can be hit with a <code>Rasterize</code>, but it needs dimensional fixing.</p>
  
  <p>And then, how to combine them together?</p>