## Not run:
# pdf('test.pdf')
# x <- seq(0,15,length=100)
# plot(x, dchisq(x, 5), xlab=tex('$x$'),
# ylab=tex('$f(x)$'), type='l')
# title(tex('Density Function of the $\chi_{5}^{2}$ Distribution'))
# dev.off()
# # To process this file in LaTeX do something like
# #\documentclass{article}
# #\usepackage[scanall]{psfrag}
# #\begin{document}
# #\begin{figure}
# #\includegraphics{test.ps}
# #\caption{This is an example}
# #\end{figure}
# #\end{document}
# ## End(Not run)
Run the code above in your browser using DataCamp Workspace