I encountered a similar problem when a spread of more than 10 ^ 6 points resulted in PDF files> 100 MB in size. The points were drawn with very low opacity (1%), so that only a lot of layered points would be visible, which would lead to something smoother distribution of density than to the scatter plot. Thus, I was very reluctant to follow the advice of Raphael Roth and thin out the data.
Instead, I found it useful to create a separate Gnuplot script for pngcairo data from the pngcairo terminal pngcairo for PNG raster images with sufficient resolution. There are no axes, ticks, borders and fields on this chart - only data displayed in the corresponding coordinates:
set terminal pngcairo transparent size 400,400 set output 'foo.png' set margins 0,0,0,0 set border 0 unset xtics unset ytics
Then, on the actual chart (for which I used the cairolatex terminal), I cairolatex this PNG image:
set terminal cairolatex pdf
Note that I am plotting using a different set of axes (without a tick) to ensure that the image fills the plot region without any border, so the labels on the x1y1 axes correspond to the actual position of the points in the scatter plot.
PNG size was only a few tens of kilobytes, PDF - a couple of MB. I think rgbalpha plot (similar to with image ) is not the most effective, but that was enough for me.
Hope someone finds this helpful.
Jonas source share