\documentclass[a4paper]{article}
\usepackage{fullpage} % just to make all the plots fit on a page
\usepackage{gnuplottex}
\title{Using gnuplottex on Overleaf}
\begin{document}
\begin{gnuplot}[terminal=pdf,terminaloptions={font ",10" linewidth 3}]
plot sin(x), cos(x)
\end{gnuplot}
\begin{gnuplot}[scale=0.8]
set grid
set title 'gnuplottex test $e^x$'
set ylabel '$y$'
set xlabel '$x$'
plot exp(x) with linespoints
\end{gnuplot}
\gnuplotloadfile[terminal=pdf]{example.gnuplot}
\end{document}