I often come to a point, where I want a plot of a set of data or just a simple function to be included into my TeX file. The usual naive approach would be to save the plot as a vector or pixel graphic and just import it with the graphicx package.
But this has a downside. Axeslabels for example are often over or undersized.
So another option I tried is gnuplot and the terminal option epslatex. Although this fixes the problem with the axeslabel writing both a vector graphic file and a tex file I found this method to be very impractical when I wanted to change (a small mistake e.g.) in the axeslabel.
So I wanted to know what is the most practical way of creating and including a plot in a LaTeX file making it compatible with size and font of the pdfLaTeX output?
EDIT: The emphasis lies on plotting data points from a file (not plotting an analytic function, thats just to show some limiting behavior).
pgfplots
andpgfplotstable
R
and integrate in your.tex
document withSweave
is perfect for the job. Another option would begnuplot
using theepslatex
terminal.