gptex2eps is a bash script for automating the process of creating postscript or pdf images from gnuplot with embedded latex-commands and font.
.gp
for
example, say myfigure.gp
). Use at least the gnuplot
commands:
set term pslatex set output 'myfigure.tex'And then put any latex-code inside $-signs. Note that in the plot-titles, double backslash must be used. See this full example:
set term pslatex set output 'example2.tex' set xlabel '$x$' set ylabel '$\gamma(x)$' set xrange [-2:2] set yrange [-0.5:1.5] plot 1/(1+x*x) title '$\\gamma(x) = \\frac{1}{1+x^2}$' with lines lt 2which results in this postscript file: example2.eps after running the command (the gnuplot-code saved to
example2.gp
):
$ gptex2eps example2.gp
Consult the postscript or pdf documentation for further help and hints.
bin
in
your home-directory, /usr/local/bin
or something alike. Make sure
they are executable by running chmod 755 gptex2eps gptex2pdf
.