On page 42/571 of the pgfplots package there is an example using \addplot+
and gnuplot
as below:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+ [id=parable,domain=-5:5,] gnuplot {4*x**2 - 5} node [pin=180:{$4x^2-5$}]{};
\end{axis}
\end{tikzpicture}
\end{document}
I run using pdfLaTeX getting an error:
Package pgfplots Error: Sorry, the gnuplot-result file 'f2_addplot_pgfplots_p
p42.parable.table' could not be found. Maybe you need to enable the shell-escap
e feature? For pdflatex, this is '>> pdflatex -shell-escape'. You can also invo
ke '>> gnuplot .gnuplot' manually on the respective gnuplot file..
See the pgfplots package documentation for explanation.
Type H for immediate help.
...
l.9 ...t {4*x**2 - 5} node [pin=180:{$4x^2-5$}]{};
Do you know how to fix this? Should I install gnuplot?
cmd
and typegnuplot --version
which should return something similar tognuplot 5.2 patchlevel 8
). 2. You need to run pdflatex with shell-escape, i.e.pdflatex -shell-escape ...
orpdflatex --enable-write18 ...
.enable shell escape
+ your editor. Maybe you can find it in the help of your editor or another resource of your editor. Let us know if you were successful. Good luck!