The following minimal example shows how I make a plot using gnuplot to the "epslatex" terminal and want to include it in my document. However, the axis texsts do not show.. What might be wrong? Gnuplot makes a .tex file and an .eps file. I should have thought it was going to use both when converting to PDF. This is pdflatex by the way.
==GNUPLOT==
set format "$%g$"
set xlabel "Temperature $T_t$"
set ylabel "Difference $|f(s')-f(s)|$"
set xrange [0.1:20]
set yrange [1:20]
set zrange [0:1]
set terminal epslatex
set output "prob.eps"
splot exp(-y/x) title ""
==latex==
\documentclass[10pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\includegraphics{prob}
\end{document}
Best Answer
The
epslatex
terminal produces two files: A.tex
file with the labels, and an.eps
file with the graphical elements. The.tex
file inserts the.eps
file itself, so all you have to do is insert the.tex
file using\include
or\input
.Instead of trying to figure out how to correct the label placement, may I suggest you give PGFplots a try? It can create plots of many mathematical functions and of data within LaTeX, and if you need really complicated mathematics, it can use gnuplot as a back end. The advantage of PGFplots over the
epslatex
terminal is that it's much easier to adjust the appearance of the plots. Your plot could be created usingCompiling this with
pdflatex
will yield