I have a function which creates a plot that has roughly 500,000 data points on it. When I print this figure to a pdf and open the pdf file it takes slightly longer to open than a less complex plot (meaning less data points). A colleague of mine uses the same function to generate the same plot and print to pdf; when he opens this pdf file it may take 5 minutes to display the plot.
He can send me the pdf file generated on his machine and it still takes longer than expected to open the file on my machine.
I was under the impression that when printing to a pdf I was essentially saving an image. Why would a complex plot with more data points take longer to open (as a pdf) than a plot with less data on it if this is true?
Problem is occurring on a Windows 64-bit machine running Matlab 2014b. I am using a Windows 64-bit machine running Matlab 2013b.
I have tried specifying the resolution '-r300' but that does not seem to make a difference.
Is there a different way I can save this figure to a pdf file to avoid this problem?
I have included some sample code which reproduces the results:
t = linspace(0,10,500000);
A = 10;
x(i) = A*sin(40*pi*t(i))+rand(1)/2;
y(i) = A*cos(40*pi*t(i))+rand(1)/2;
hf = figure;
Thanks for the help!