I would like to produce a output PDF file of a log-linear plot obtain by composing the plot of an analytical function and a scatter plot of some random data. Since the random points are of the order of $10^4$ or even more, a full-vector PDF is very heavy and PDF viewers get very slow.
Here is a simplified example of my plot:
list = With[{n = 500},
MapThread[{10^#1, #2*(1 - Exp[-10^#1])} &,
{RandomReal[{-3, 2}, {500}], RandomReal[{0, 1}, {500}]}]];
Show[ListLogLinearPlot[list, PlotStyle -> LightGray],
LogLinearPlot[1 - Exp[-x], {x, 0.001, 100}]]
To overcome this problem I would like to have the random points rasterized, while keeping the axes and the analytical function in vector format for readability.
I tried by rasterizing the output of ListLogLinearPlot
with Axes -> None
with Inset and Overlay, but I'm unable to find a way to superimpose it to the other plot and make the two figures coincide. I've also tried to modify the code in this answer to no avail.
How can I achieve the desired result? Ideally, the method should be robust to changes in the PlotRange, i.e. it shouldn't require manual fine-tuning of position and size.
Take[list,{1,-1,10}]
in yourListLogLinearPlot
function produce an acceptable output? $\endgroup$