When I include R plots in a latex document using knitr, symbols do not show properly when knitr's graphic device is 'pdf', while everything is OK when the graphic device is 'png'. Here is a MWE:
\documentclass{article}
<<>>=
library(knitr)
library(survival)
attach(lung)
@
\begin{document}
A sample figure with default 'pdf' device.
<<>>=
plot(age, meal.cal)
@
\clearpage
Same figure, with 'png' device.
<<dev='png'>>=
plot(age, meal.cal)
detach(lung)
@
\end{document}
Here is the result: https://drive.google.com/open?id=1fz_6XuDxdDWNhX_EWRnUYInSG-pklkuA
In the first graph the circles are not drawn, while the second graph is fine. Any suggestion?
Cairopdf
device from the RCairo
package, that sometimes works better than the defaultpdf
device.libcairo2-dev
andlibxt-dev
.