The following code does not compile. I use the following packages.
\documentclass[12pt]{article}
\renewcommand{\textheight}{620pt}
\renewcommand{\textwidth}{450pt}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{subfig}
\usetikzlibrary{calc,shadings}
\usepackage{pgfplots}
\usepgflibrary{shapes.geometric}
\begin{tikzpicture}
\begin{axis}[legend cell align=center,legend pos=outer north east]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{a,fine,legend}
\end{axis}
\end{tikzpicture}
\begin{document}... \end{document}:) – percusse Aug 23 '12 at 6:47\begin{document}...\end{document}is missing. If I add that back in, the example compiles correctly (with the legend outside the top right corner of the plot). – Jake Aug 23 '12 at 6:54\begin{document}...\end{document}works. – Claudio Fiandrino Aug 23 '12 at 6:54