I used R to get different plots. I saved them as pdf. I went to my tex. file and I used \includegraphics command. The plot came but it does not have labels on, that is, x-labels, y-labels and title-labels. Please advice.
Asked
Active
Viewed 1,211 times
1
Torbjørn T.
- 206,688
1 Answers
1
Whithout a minimal working example (see I've just been asked to write a minimal example, what is that?) is hard to guess the problem, but a way to overcome this problem and simplify your work is use Sweave (or knitr). Briefly:
1) First, you can make a file.Rnw like this:
\documentclass{article}
Some \LaTeX{} text.
\begin{document}
\SweaveOpts{concordance=TRUE}
<<echo=F,fig=T>>=
data(CO2)
attach(CO2)
plot(uptake~conc, xlab="x label", ylab="y label", main="The main label")
@
\end{document}
2) Then, compile it with R to obtain a file.tex:
R CMD Sweave file.Rnw
3) Finally, Compile your file.tex as usual to obtain file.pdf.
For simple files as the above MWE, or a working preview, where just one pdflatex compilation is enough, you can omit the step 3 and use the--pdf option in 2:
R CMD Sweave --pdf file.Rnw
.pdfwhich was saved from R? Try different pdf-viewers on the.pdfcreated by latex and try zooming in and out in case it is "only" a problem of visualisation of the pdf-viewer – samcarter_is_at_topanswers.xyz Jun 06 '14 at 18:09