# Gnuplot epslatex terminal not showing axis text

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}

-
At the moment you're just including the EPS file, because you're using \includegraphics. You need to include the .tex file, which will in turn include the EPS. Try \include{prob} or \input{prob}. – Jake Jun 7 '12 at 11:19
Ah, right. This gives me something but the placing of the labels is completely off! – Martin Lauridsen Jun 7 '12 at 11:53

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.

\documentclass[10pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\input{prob}
\end{document}


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 using

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5.1}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=10cm, height=6cm,
domain=0.1:20, xmin=0,
y domain=1:20,
view={20}{50},
xlabel=Temperature $T_t$,
ylabel=Difference $|f(s')-f(s)|$,
ylabel style={anchor=west},
colormap/cool
]

Compiling this with pdflatex will yield
For stretching the plot, you can set width=<value> and height=<value>. If you only set one of the two options, the plot will be scaled proportionally. – Jake Jun 7 '12 at 12:29
That error dialog is a bit strange, that shouldn't happen. To speed up compilation, you can put \usetikzlibrary{external} \tikzexternalize into your preamble, then the graph will be compiled into a separate pdf on the first run. On subsequent runs, only that pdf will be included, instead of having to recalculate the whole plot. If you want to change something about the plot, you'll have to put \tikzset{external/remake next} in front of the \begin{tikzpicture} to update the externalized pdf. – Jake Jun 8 '12 at 12:25