From comments to a different answer, I gather that you want to include plots generated with
Gnuplot comes with many different "terminals", which are output filters that generate different file formats. A common one is
postscript (which generates postscript files), or
png for generating PNG raster images. If you build your plots interactively from a
gnuplot command line, you are probably using the
wxt terminal, which outputs the plots to your screen.
gnuplot plots in LaTeX documents, there are other terminals that are better suited than the terminals which generate standalone image files, because they let LaTeX take care of typesetting the text:
epslatex terminal generates two files: One
.tex file that includes all of the text and numbers, and one
.eps file that includes the graphics.
To use it, do the following: After setting up your plot as usual (by using a sequence of setup commands or by loading a
gnuplot file) issue the command
set terminal epslatex color at the
gnuplot> prompt; then
set out "filename.tex";
replot (or just
plot followed by the function, if that is all you need); and finally
set out without a file name, which closes the files. You have now generated the
In your LaTeX document, you just include the graph using
.eps file will be included automatically. If you want a bigger font size, just use
tikz terminal generates a
.tex file that contains TikZ code to generate the graph directly in LaTeX.
To use it, you use
set terminal tikz, after that the procedure is identical to that for the
epslatex terminal. In your LaTeX document you must also load the
Here's a complete example using the
gnuplot> set terminal epslatex color
Terminal type set to 'epslatex'
Options are ' leveldefault color blacktext dashed dashlength 1.0 linewidth 1.0 butt noclip palfuncparam 2000,0.003 noheader "" 11 '
gnuplot> set out "epslatexfile.tex"
gnuplot> set samples 400, 400
gnuplot> plot [-10:10] real(sin(x)**besj0(x))
gnuplot> set out
A minimal LaTeX document to include the output from
gnuplot could look like this:
Yielding this output: