Whenever I output figures for academic research papers, I try as much as possible to prevent rasterization, which is one of my personal quirks, I guess. I have succeeded so far using Mathematica, but I sometimes bump into unexpected rasterization.
Consider the following simple example:
Plot[Exp[-x^2], {x, -5, 5}, ColorFunction -> "Rainbow"]
Export["test.pdf",%]
The output file is rasterized, and as far as I can tell, it is because of the color gradient. My knowledge of vector graphics is limited, and I understand that trying to output a vectorial image from a DensityPlot is borderline insane (and looking on stackexchange there are many clever ways around this by rasterizing only the heatmap and not any of the text or curves). However, it doesn't seem crazy to have a simple plain vector with a color gradient, Illustrator or Inkscape can do this very easily and the output file is lightweight.
I have tried many different ways, but couldn't prevent rasterization in this simple example.
Is there an easy way out of this, or one would need to overlay a rasterized curve on top of a blank plot ?
Many thanks.
ListPlot[Table[Exp[-x^2], {x, -5, 5, .1}], ColorFunction -> "Rainbow"]
, which should be very simple, is rasterized. $\endgroup$