Rather than adding a second x axis by putting it on the other side of the plot I would like to add one implicitly simply by adding another row of tick labels to an existing axis. What I am after is something like the following mockup:

Using the idea in this answer I have tried to come up with something like this but there are some problems and maybe there is a better approach to the issue?

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{
domain=0:1,
xmin=0, xmax=1,
ymax=1, ymin=0
}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[xtick align=inside,
extra x ticks={0.2, 0.4, ..., 0.8},
extra x tick labels={0.33, 0.33, 0.33, 0.33},
every extra x tick/.style={
xtick align=outside,
},
xlabel=\(x_1\),
after end axis/.code={
\node at (rel axis cs:1,0) [anchor=south west, align=left] {\(x_2\)};
}
]
\addplot{x};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}

groupplotsthe position of x1 and x2 is not right. – N.N. Aug 06 '12 at 15:02\addplot{x - 0.5};and you can see that x1 and x2 are displaced. – N.N. Aug 06 '12 at 15:17axis descriptioncoordinate system should fix the problem. – Gonzalo Medina Aug 06 '12 at 15:40clip=false? Without clip some functions, e.g.\addplot{ln(1 / x)};, grows outside the axis. A fix might be to userestrict y to domain=-1:1,but I dunno if it is the right way to go. – N.N. Aug 06 '12 at 16:00x_1,x_2should appear outside the box, I think that usingclip=falseandrestrict y to domain(as you suggest) is the way to go. – Gonzalo Medina Aug 06 '12 at 16:34restrict x/y/z to domainwith a value equal to the axis limits. – N.N. Aug 06 '12 at 17:19restrict x/y/z to domaincan prevent the error in those cases. I don't see any warning about the use of the option with sensible values. – Gonzalo Medina Aug 06 '12 at 17:29