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?

Stefan Pinnow
  • 29,535
user151562
  • 630
  • 5
  • 19

1 Answers1

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.)