\documentclass{article}
\usepackage{siunitx}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableset{ %
create on use/SquareLight/.style={
create col/expr={\thisrow{Dark}}}
}
\pgfplotstableset{ %
create on use/SquareLight(1)/.style={
create col/expr={\thisrow{Dark}}}
}
\begin{tikzpicture}
\pgfplotsset{width=10cm,
compat=1.3,
legend style={font=\footnotesize}}
\begin{axis}[
%scaled y ticks=base 10:7,
xlabel={$n$},
ylabel={$r^2$, м$^2$},
legend cell align=left,
legend pos=south east,
grid=major,
width=1\linewidth,
height=0.7\linewidth,]
\addplot[
orange,
only marks,
]%
table[
x=n,
y expr={\thisrow{Dark}}]{dark(1).dat};
\addlegendentry{Messpunkte}
\addplot[orange,
]%
table[y={create col/linear regression={y = SquareLight}}]{dark(1).dat};
\addlegendentry{%
$\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x
\pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$ lin. Regression
} %
\addplot[
red,
only marks,
]%
table[
x=n,
y expr={\thisrow{Dark}}]{dark(2).dat};
\addlegendentry{Messpunkte}
\addplot[red,
]%
table[y={create col/linear regression={y =SquareLight(1)}}]{dark(2).dat};
\end{axis}
\end{tikzpicture}
\end{document}