require(graphics)
pictex()
plot(1:11, (-5:5)^2, type = "b", main = "Simple Example Plot")
dev.off()
##--------------------
## Not run:
# %% LaTeX Example
# \documentclass{article}
# \usepackage{pictex}
# \usepackage{graphics} % for \rotatebox
# \begin{document}
# %...
# \begin{figure}[h]
# \centerline{\input{Rplots.tex}}
# \caption{}
# \end{figure}
# %...
# \end{document}
# ## End(Not run)
##--------------------
unlink("Rplots.tex")
Run the code above in your browser using DataLab