I would like to integrate gnuplot directly into TexMaker. I have installed gnuplot and calling it from Terminal works perfectly.
student-net-nw-2811:~ aris$ gnuplot
G N U P L O T
Version 5.2 patchlevel 6 last modified 2019-01-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2018
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type is now 'aqua'
gnuplot>
In TexMaker I enabled --shell-escape and --enable-write18 as followed
pdftex --shell-escape --file-line-error --synctex=1 --enable-write18
From the .log File it seems that TexMaker can't find the path to gnuplot. The path is:
student-net-nw-2811:~ aris$ which gnuplot
/opt/local/bin/gnuplot
How can i fix this problem so that i can compile directly in TexMaker and don't need to run the Terminal first with the code
latex --shell-escape test.tex
Thanks for your help.
Edit:
Adding \usepackage{gnuplottex} occurs in following error
! LaTeX Error: File `gnuplottex.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Edit: A minimal code example is:
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
% GNUPLOT required
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[domain=-1:1]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red] plot[id=x^3] function{x*x*x}
node[right ] {$f(x) =x^3$};
\draw[color=blue] plot[id=sin] function{sin(x)}
node[below right] {$f(x) = \sin x$};
\draw[color=orange] plot[id=cos] function{cos(x))}
node[below right] {$f(x) = \frac{1}{20} \mathrm e^x$};
\end{tikzpicture}
\end{document}
latex.exe"--shell-escape -synctex=1 -interaction=nonstopmode %.texas--enable-write18is a MiKTeX thing. – naphaneal Mar 14 '19 at 10:02latex --enable-write18 -synctex=1 -interaction=nonstopmode %.tex– naphaneal Mar 14 '19 at 10:09^has a special meaning in LaTeX. it is used for superscripting text. to use it in different context, you either have to escape or redefine it. – naphaneal Mar 14 '19 at 10:21