I'm trying to plot a scatter plot with curve fitting trendline of polynomial degrre 3. I have been able to create the required graph with trendline in excel. I tried to plot the same graph with the latex/tiktz but i'm failing to get the trendline in the latex graph. The expected graph is as below

Although my scatter plot image from my latex code is as below
The latex code for image is as below
\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ enlargelimits=false,
]
\addplot+[
color=black,
only marks,
scatter,
mark=halfcircle*,
mark size=2.9pt
]
table[meta=SPL(dB)]{data2.dat};
\addplot [ smooth,thick, red]
gnuplot [raw gnuplot] { % "raw gnuplot" allows us to use arbitrary gnuplot commands
f(x) = a*x^3+b*x^2+c*x+d; % Define the function to fit
a=0; b=0,c=0,d=0; % Set reasonable starting values here
% Select the x-range, the file, the columns (indexing starts at 1) and the variables for fitting
fit [0:8000] f(x) 'data2.dat'% u 1:2 via a,b,c,d;
plot [x=0:8000] f(x); % Specify the range to plot
};
%table[ y={create col/linear regression={y=SPL(dB)}}]{data2.dat};
\end{axis}
\end{tikzpicture}
\end{document}
I would like that latexshould draw the curve by auto fitting maximum points with smooth curve, I'm not sure what sort of code needs to be used here.
The data file used in the graphs has data below:- contents of data2.dat are as below
Frequency(Hz) SPL(dB)
50 63.8
100 65.5
200 71.7
300 74.5
400 78.1
500 83.8
600 82.8
700 85.9
800 88
900 87.8
1000 87.1
1500 84.8
2000 93.8
2500 95.1
3000 93.3
3500 89.1
4000 89
4500 86
5000 83.3
5500 84.7
6000 81.2
6500 85.4
7000 80.3
7500 83.3
8000 81.7


pgfplots, e.g.\addplot {4e-10*x^3 - 6e-6*x^2 + 0.022*x + 68.74};– Torbjørn T. Apr 30 '18 at 09:59