# Gnuplot in LaTeX

I am trying to get a plot using gnuplottex:

\documentclass[12pt]{article}
\usepackage{graphicx, latexsym, keyval, ifthen, moreverb}
\usepackage{gnuplottex}

\begin{document}

\begin{figure}
\begin{gnuplot}[terminal=epslatex, terminaloptions=rotate]
plot sin(x)
\end{gnuplot}
\caption{My figure.}
\end{figure}

\end{document}


But I get caption without any figure. I am using TeXShop. How can I get the plot.

• Did you look in the log file? I get a warning like this:  Package gnuplottex Warning: Shell escape not enabled. (gnuplottex) You'll need to convert the graphs yourself – daleif Aug 1 at 14:18
• Plus: Package gnuplottex Warning: Gnuplot execution produced errors: set terminal epslatex rotate – daleif Aug 1 at 14:20
• @daleif The log file has a line: Package gnuplottex Warning: Please convert gnuplt-gnuplottex-fig1.gnuplot manually. So, what is to be done here. – An student Aug 1 at 14:43
• you tell me. gnuplot is an external programme, it is not a part of latex. Do you have it installed? if so, run gnuplot on that file. – daleif Aug 1 at 14:44
• Note that unless you really need to, there is mot much reason to use gnuplot to for example plot a function. LaTeX can do that by itself using pgfplots. – daleif Aug 1 at 14:45

You are forcing the warning with terminaloptions = rotate. The following code works for me:

\documentclass[a4paper, 11pt]{article}
\usepackage{graphicx, latexsym, keyval, ifthen, moreverb}
\usepackage{gnuplottex}

\begin{document}

\begin{figure}
\begin{gnuplot}[terminal=epslatex]
plot sin(x)
\end{gnuplot}
\caption{My figure.}
\end{figure}

\end{document}


As daleif already noted in the comments, I would recommend you not to use gnuplottex, since there are way better alternatives as pgfplots.