# How to align the legend in pgfplots?

The mwe is

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\end{document}


The two legends have the different length and they vertical align at the center. Now I want to align the legend at the left. How can I do this?

You only need add to axis option :legend cell align=left (see Manual for Package PGFPLOTS, page255):

\documentclass[tikz,margin=3mm]{standalone}
\usepackage{pgfplots}