I am trying to plot my second plot in my thesis, and while the first one work (which is almost identical to the one I'm doing now) it won't work. Here's my code:
\begin{figure}[h]
\caption{something}
\label{blabla}
\begin{center}
\begin{tikzpicture}
\begin{axis}[width=12cm,height=6cm,
ylabel={Ugearet $\beta$},
xmin=2005, xmax=2016,
ymin=0.0, ymax=2.0,
xtick={2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016},
ytick={0.0,0.25,0.50,0.75,1.0,1.25,1.50,1.75},
xticklabel style={/pgf/number format/1000 sep=,rotate=60,anchor=east,font=\normalsize},
legend pos=north east,
ymajorgrids=true,
grid style=dashed,
]
\addplot
\draw [ultra thick, dotted, draw=red]
(axis cs: 2016,1.14) -- (axis cs: 2016,1.14)
node[pos=0.5, above] {$y=12$};
\addplot[
color=blue,
mark=pentagon*,
]
coordinates {(2006,1.88)
(2007,0.76)
(2008,0.95)
(2009,0.75)
(2010,0.90)
(2011,0.80)
(2012,0.92)
(2013,0.74)
(2014,1.28)
(2015,1.36)
(2016,1.28)
};
\addlegendentry{Dansk bioteknologisk industri beta}
\end{axis}
\end{tikzpicture}
\centering Kilde:
\end{center}
\end{figure}
All I'm trying to do is to plot a horizontal line, with the average "beta" of 1.14. I did this in my previous plot (earlier in my thesis) but it won't let me do it now..
Any help is greatly appreciated!

pgfplotsthen(2016,1.14)and(axis cs: 2016,1.14)ought to be the same thing (if I'm not mistaken) – daleif Mar 21 '17 at 14:26\pgfplotsset{compat=1.11}(or higher). – Torbjørn T. Mar 21 '17 at 17:25compatsetting might be recommended. – Torbjørn T. Mar 21 '17 at 17:31