1

I'm trying to plot a sine wave, however, when I run it, the following error results:

Package pgfplots Error: Sorry, the gnuplot-result file 'main.sin.table' could not be found. Maybe you need to enable the shell-escape feature? For pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnuplot .gn uplot' manually on the respective gnuplot file..

My MWE is the following:

 \documentclass[14pt]{extarticle}
 \usepackage[margin=1in]{geometry} 
 \usepackage{amsmath,amsthm,amssymb,vector,physics,enumitem,mathtools}
 \usepackage{etoolbox}
 \usepackage[explicit]{titlesec}
 \usepackage{esvect}
 \usepackage{tikz}
 \usepackage{varwidth}
 \usetikzlibrary{calc,patterns,angles,quotes}
 \usetikzlibrary{through,calc,arrows}
 \usepackage{pgfplots}

 \begin{document}
 \begin{tikzpicture}
 \begin{axis}[
    xlabel=$x$,
    ylabel=$\sin(x)$
]
% invoke external gnuplot as
% calculator:
\addplot gnuplot[id=sin]{sin(x)};
\end{axis}
\end{tikzpicture}

\end{center}
\end{document}

I already try solve it by following this answer: How to enable shell-escape in TeXworks?

Can anyone help me, please?

7
  • do you have gnuplot installed? Apr 25, 2018 at 18:58
  • Yes, I do. I just installed it.
    – user151562
    Apr 25, 2018 at 19:13
  • You can plot a sine without gnuplot.
    – user121799
    Apr 25, 2018 at 19:28
  • Can you tell me how @marmot?
    – user151562
    Apr 25, 2018 at 19:36
  • Just remove gnuplot (I think). I also find it strange that you don't specify a domain. This should work: \addplot[domain=0:6,samples=100][id=sin]{sin(deg(x))}; .
    – user121799
    Apr 25, 2018 at 19:38

1 Answer 1

1

Too long for a comment. Can you compile

\documentclass[14pt]{extarticle}
 \usepackage[margin=1in]{geometry} 
 \usepackage{pgfplots}

 \begin{document}
 \begin{tikzpicture}
 \begin{axis}[
    xlabel=$x$,
    ylabel=$\sin(x)$
]
\addplot[domain=0:6,samples=100,id=sin]{sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{document}

On my TeXLive 2017 distribution it produces.

enter image description here

Notice that I have stripped off all unnecessary packages and libraries. (And I do not have vector.sty.)

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .