# Add space around series image in pgfplots legend

I would like to add space around the image in a legend. MWE:

\documentclass{standalone}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[legend columns=-1]
\end{axis}
\end{tikzpicture}

\end{document}


Current Output:

Desired Output:

The best approach I have come up with is to make give the second series a white line in addition to its black marks, but this looks odd if the background is not white or the line crosses over other series.

You can do whatever you want by defining your own legend style if you don't want to tweak all the time.

\documentclass{standalone}
\usepackage{pgfplots}
my legend/.style={legend image code/.code={%
\draw[##1]plot coordinates{(0cm,0cm)(0.3cm,0cm)(0.6cm,0cm)};}
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]

• @user1476176 For example you can add sharp plot,draw opacity=0 to the legend options just what you though before. – percusse Jul 20 '18 at 0:28