\documentclass[border=1pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=9cm,height=5cm,compat=1.6}
\begin{document}

\newcommand{\labelsAllMath}{E'}
\newcommand{\fdev}{$F1({\labelsAllMath{}})$}

\begin{tikzpicture}
\hspace{-2mm}
  \begin{axis}[
      xticklabels={1, 2, 3, 4, 5, 6, 7},  % Set the corresponding labels for the ticks
      xtick={0,1,2,3, 4, 5, 6},          % Set the tick positions on the X-axis
      legend pos=north east,  % Set the legend position to the northwest
      legend cell align={left}, % The command for legend alignment
      tick label style={font=\scriptsize}, % Set tick label font size
      label style={font=\scriptsize}, % Set axis label font size
      legend style={font=\footnotesize}, % Set legend font size
      xlabel={epochs},
      ylabel={\fdev{}},
      ylabel style={
          outer sep=0pt,
      },
      xlabel style={
          outer sep=0pt,
        },
  ]

    \addplot+[sharp plot, mark=triangle] coordinates
{(0,45.161) (1,47.809) (2,46.863) (3,46.507)};

    \legend{\textsc{THoR\textsubscript{state}}};

  \end{axis}
\end{tikzpicture}
\end{document}