I would like to add a legend header to one of my pgfplot. So far I get that
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin=0,
ymax=1,
enlargelimits=false,
legend pos=north west,
legend style={area legend},
legend columns=-1
]
\addlegendimage{empty legend}
\addlegendentry[yshift=10pt]{Header legend}
\addplot
[const plot,fill=blue,draw=black]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)}
\closedcycle;
\addlegendentry{histo 1}
\addplot
[const plot,fill=red,draw=black]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)}
\closedcycle;
\addlegendentry{histo 2}
\end{axis}
\end{tikzpicture}
\end{document}
which gives me that

I would like to have the second row to be left aligned with respect to the first one. I do not want to fix the number of row because there may be more histograms to come and I would like to have them horizonthally aligned (that's why I use legend columns=-1).
I read here that pgfplots legend is nothing else than tikz matrix so maybe there is a way to x-shift the second row (as I already did with the yshift=10pt command).
\matrixas far as I know. A patch has been proposed in http://tex.stackexchange.com/questions/1388/multirow-multicolumn-cells-in-tikz-matrices - perhaps that might work here as well – Christian Feuersänger Nov 10 '12 at 17:15