Does someone know how can i change the position of my legend to right-side of my graph? I try many things but i can't. Please give me some help! Here is my code!
\resizebox{\textwidth}{!}{
\begin{minipage}{1.3\textwidth}
\begin{center}
\begin{tikzpicture}
\begin{axis}[ /pgf/number format/.cd, use comma, 1000 sep={}, scale only axis, xmin=2006,xmax=2012, ymin=65, ymax=125, axis y line*=left, xlabel=Year, ylabel=\color{black}$Percentage(\%)$]
\addplot[black] coordinates {
%Government Debt
(2006, 68.3608)
(2007, 68.0186)
(2008, 74.963)
(2009, 89.5022)
(2010, 102.7844)
(2011, 114.9962)
(2012, 121.9426)};
\end{axis}
%
\begin{axis}[ scale only axis, xmin=2006,xmax=2012, ymin=-15, ymax=5, axis y line*=right, axis x line=none, ylabel=\color{blue}$Percentage (\%)$]%
\addlegendimage{/pgfplots/refstyle=Hplot}
\addlegendentry{$Debt$}
\addplot[blue, mark=+] coordinates {
%Total Budget Balance
(2006, -1.5862)
(2007, -1.9186)
(2008, -5.624)
(2009, -9.7638)
(2010, -13.0882)
(2011, -8.0618)
(2012, -6.4806)};
\addlegendentry{$TBB$}
%
\addplot[blue,mark=o] coordinates {
%Real per capita GDP growth rate
(2006, 3.7266)
(2007, 3.3016)
(2008, -0.5192)
(2009, -4.1474)
(2010, -0.4744)
(2011, -1.2876)
(2012, -2.4802)
};
\addlegendentry{$GDPpc GR$}
\end{axis}
\end{tikzpicture}
\end{center}
\end{minipage}}


\documentclass{...}and ending with\end{document}. – Sep 10 '14 at 11:42legend pos=outer north eastas described on page 208 of the pgfplots 1.11 manual. Related: http://tex.stackexchange.com/q/134084/32374 http://tex.stackexchange.com/q/83328/32374 http://tex.stackexchange.com/q/4085/32374 – darthbith Sep 10 '14 at 12:25