Possible Duplicate:
Using a pgfplots-style legend in a plain-old tikzpicture
I'm trying to accomplish this: I have a plot with two y-axes. The first y has two plots, the second has one. I manage to plot them all but how can I create a single legend which will give me all three plots?
The basic code looks like this:
\documentclass{article}
\usepackage{tikz}
\usepackage{caption}
\usepackage{pgfplots}
%
\begin{document}
\documentclass{article}
\usepackage{tikz}
\usepackage{caption}
\usepackage{pgfplots}
%
\begin{document}
\begin{figure}[h!]
\begin{tikzpicture}[]
\begin{axis}[]
\addplot[]
plot coordinates {
};
\addplot[]
plot coordinates {
};
\end{axis}
\begin{axis}[]
\addplot[]
plot coordinates {
};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}