I am trying to include a single, less than one-page-sized plot into a Sweave
/R
pdf document. This plot is based on huge amounts of data - i.e. in a small plot area there are tens of thousands of points. Whenever I include the plot normally through Sweave, I get huge lag when I open the resulting pdf. This is similar to the case of exporting an eps
with tens of thousands of dots - even though the plot area is small it will lag heavily.
How do I code it such that a png
is inserted, or equivalent, which doesn't keep all the information of every dot in the plot but just keeps the information of the pixels corresponding to the plot size?
\begin{figure}
\begin{center}
<<fig=TRUE,echo=FALSE,height=4>>=
plot(rnorm(100000))
@
\end{center}
\caption{Visualisation in Sweave which can lag computers}
\end{figure}
I am looking for a LaTeX solution. This means no PNG