[Tex/LaTex] pgfplots: problem in the legend using custom marks

legendpgfplots

With the help of \pgfdeclareplotmark I defined a custom mark for a plot and it worked as expected; however, in the legend, the mark appears with a vertical shift. What is causing this problem and how can it be prevented?

\documentclass{article}
\usepackage{pgfplotstable}
\usetikzlibrary{shadows}
\pgfplotsset{compat=1.8} 

\pgfdeclareplotmark{*)}
  {\shade[draw=green!60!black,ball color=green!70] (0,0) circle [radius=5pt];}

\begin{document}

\begin{tikzpicture}
\begin{axis}[]
\addplot+[mark=*)]  
coordinates {
 (-2,3)
 (1,-5)
};
\addlegendentry{test}
\end{axis}
\end{tikzpicture}

\end{document}

enter image description here

Best Answer

Interestingly, this can be fixed by using (0pt, 0pt) instead of (0,0) in the plot mark definition. Some PGF vs. TikZ problem, perhaps.

\documentclass{article}
\usepackage{pgfplotstable}
\usetikzlibrary{shadows}
\pgfplotsset{compat=1.8} 

\pgfdeclareplotmark{*)}
  {\shade[draw=green!60!black,ball color=green!70] (0pt, 0pt) circle [radius=5pt];}

\begin{document}

\begin{tikzpicture}
\begin{axis}[]
\addplot+[mark=*)]  
coordinates {
 (-2,3)
 (1,-5)
};
\addlegendentry{test}
\end{axis}
\end{tikzpicture}

\end{document}