3

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}
  • 2
    Welcome to TeX.sx! Your post was migrated here from [so]. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Dec 15 '12 at 15:58
  • 1
    see also http://tex.stackexchange.com/questions/54794/using-a-pgfplots-style-legend-in-a-plain-old-tikzpicture . I guess such a "customlegend" would be a good addition to pgfplots anyway. – Christian Feuersänger Dec 15 '12 at 17:32
  • Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Martin Schröder Dec 15 '12 at 20:04
  • Thanks for the tipps. I'm new here, so I'm still getting to know the community. So far, you guys have been really helpful and fast. – user1889382 Dec 17 '12 at 09:48

0 Answers0