Installation worked out of the box: sudo apt install gnuplot-qt
. I decided to use the qt version, since I am also very happy with the Python/Matplotlib backend QtAgg (see https://matplotlib.org/stable/users/explain/figure/backends.html)
Calling gnuplot from LaTeX worked also out of the box. In TexStudio / Options / Configure TexStudio... I use pdflatex -synctex=1 -shell-escape -interaction=nonstopmode %.tex
.
\begin{tikzpicture}
\begin{axis}[
xmin=-pi, xmax=pi,
ymin=-2, ymax=2,
title=Sine Wave,
legend pos=south east, legend style={draw=none},
]
% gnuplot script inside brackets {}
\addplot gnuplot[raw gnuplot, id=sin,mark=none,color=violet] {plot sin(x)};
\addlegendentry{sin(x)}
\end{axis}
\end{tikzpicture}
Thank you for your help.
Best regards, philipp