# pgfplot xbar legend ordering

when I am drawing a xbar chart, I have troubles with the legend entries. They appear to have the opposite ordering as I suppose they should have.

\begin{tikzpicture}
\begin{axis}[xbar]
\end{axis}
\end{tikzpicture}


Either the bar position should switch or the legend label position. Somethings seems to be wrong here.

Maybe anyone has an idea?

You can reverse the order of the legend entries by setting reverse legend:

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[xbar, reverse legend]