GnuPlot figure inclusion into LaTeX

  1. Generate your figure in GnuPlot, i.e.
    f(x)=x*(1-exp(-0.1/x))
    g(x)=x*(1-exp(-0.1/x))/(2+4.3*x*(1-exp(-0.1/x)))
    set xrange [0:0.2]
    set xlabel "$dot{m},/,left[{rm kg/s}right]$"
    set ylabel "$frac{dot{Q}}{c_p,(T_{HX}-T_{air}^{in})}$"
    set style line 1 lt 2 lc rgb "red"     lw 2 pt 2 ps 3
    set style line 2 lt 3 lc rgb "#008800" lw 2 pt 3 ps 3
    set term epslatex color solid 12
    set output "QHX.eps"
    plot f(x) ti "" w l linestyle 1, g(x) ti "" w l linestyle 2
    
    If you use LaTeX-Formulas for description be shure to use double backslashes.
  2. Since there exists no pdflatex output option you have to convert the figure by epstopdf in case you are using pdflatex.
  3. The inclusion into your LaTeX-document works via
    begin{figure}
    begin{center}
    input{../GPlot/myPlot.tex}
    end{center}
    caption{My curve created with gnuplot.}label{myPlot}
    end{figure}
    
    Since this figure is in this example in some other directory you have to set the correct relative path in myPlot.tex.
Login
Valid HTML 4.01!