\documentclass[border=1mm]{standalone}

\usepackage{cmap}
\usepackage[cp1250]{inputenc}	
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{float}
\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{upgreek}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepgfplotslibrary{units}
% \makeatletter
%\pgfplotsset{
%  unit code/.code 2 args=
%    \begingroup
%    \protected@edef\x{\endgroup\si{#2}}\x
%} 
%\makeatother

\pgfkeys{%
  /tikz/on layer/.code={
    \pgfonlayer{#1}\begingroup
    \aftergroup\endpgfonlayer
    \aftergroup\endgroup
  }
}

\begin{document}
	\begin{tikzpicture}
		\begin{axis}[
			height=7cm,	width=11cm,	grid=major,
    		x unit=-, y unit=\SI{}{\mega\hertz},
			xlabel=$K$,	ylabel={$f_\mathrm{inj,max},f_\mathrm{inj,min}$},
			ymin=450,ymax=700,
			xmin=0, xmax=1,
			%ytick distance = 0.1,
			set layers,
			%x tick label style={/pgf/number format/.cd, set thousands separator={}},
			xticklabel shift = 2 pt,
			legend pos=south west,
			%xtick =\empty
		]					
			
			\addplot +[smooth, solid, thick,color=blue,mark=star] table [x=K, y=f_min, col sep=semicolon] {locking_16.csv};
			\addplot +[smooth, solid, thick,color=blue,mark=star] table [x=K, y=f_max, col sep=semicolon] {locking_16.csv};
			\addplot +[smooth, dashed, thick,color=blue,mark=none] table [x=K, y=fmin theory 3, col sep=semicolon] {locking_16.csv};
			\addplot +[smooth, dashed, thick,color=blue,mark=none] table [x=K, y=fmax theory 3, col sep=semicolon] {locking_16.csv};
			
			\draw [loosely dashed, darkgray] (axis cs:0,621.8) -- (axis cs:1,621.8) ;			
			\node [darkgray] at (axis cs:0.95,632) {$f_\mathrm{0}$};			
			
			\legend{model,,theory,};
		\end{axis}
	\end{tikzpicture}
\end{document}