# pgfplots: two y-axis with three plots and one legend

After googling about my problem, I came up with this two year old question here on TeX.SX.
I adopted the example from there having two plots in the first axis-environment and one plot in the second axis-environment as given below:

\documentclass{article}

% UNITS
\usepackage{siunitx}

% GRAPHICS
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.3}

\begin{document}

\begin{tikzpicture}
\pgfplotsset{
scale only axis,
scaled x ticks=base 10:3,
xmin=0, xmax=0.06
}

\begin{axis}[
axis y line*=left,
ymin=0, ymax=80,
xlabel=x-axis,
ylabel=y-axis 1,
]
coordinates{
(0,68.6)
(0.0148,72)
(0.0295,68.6)
(0.0441,53.4)
(0.059,22.8)
}; \label{plot_one}
coordinates{
(0,60)
(0.0148,65)
(0.0295,73)
(0.0441,49)
(0.059,19)
}; \label{plot_two}
\end{axis}

\begin{axis}[
axis y line*=right,
axis x line=none,
ymin=0, ymax=100,
ylabel=y-axis 2
]
coordinates{
(0,0)
(0.0148,48)
(0.0295,66)
(0.0441,66)
(0.059,45.0)
\end{axis}

\end{tikzpicture}
\end{document}


There is a comment about my problem beneath the answer of the old question linked to above, but I do not get this hint working. So, how can I get one legend containing all three "descriptions" of the three plots?

A doubtless naïve possibility:

\documentclass{article}

% UNITS
\usepackage{siunitx}

% GRAPHICS
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.3}

\begin{document}

\begin{tikzpicture}
\pgfplotsset{
scale only axis,
scaled x ticks=base 10:3,
xmin=0, xmax=0.06
}

\begin{axis}[
axis y line*=left,
ymin=0, ymax=80,
xlabel=x-axis,
ylabel=y-axis 1,
]
coordinates{
(0,68.6)
(0.0148,72)
(0.0295,68.6)
(0.0441,53.4)
(0.059,22.8)
}; \label{plot_one}
coordinates{
(0,60)
(0.0148,65)
(0.0295,73)
(0.0441,49)
(0.059,19)
}; \label{plot_two}
\end{axis}

\begin{axis}[
axis y line*=right,
axis x line=none,
ymin=0, ymax=100,
ylabel=y-axis 2
]
coordinates{
(0,0)
(0.0148,48)
(0.0295,66)
(0.0441,66)
(0.059,45.0)

• \pgfplotsset{width=7cm,compat=1.3} is important here. Without it, my axis doesn't show on the right. – Andriy Drozdyuk Feb 10 '17 at 0:28