I use a mesh plot with scatter points (2d) where the colors are determined from a third coordinate of the data as described in this question. The legend however should contain the markers of a curve as icon (not that miniature mesh). How can I achieve that?
Edit: the problems seems to be with legend image code in line legend that does not draw correctly with mesh settings. How do I have to modify a custom legend image code to simply display the current marker in a fixed color (say black)?
My attempt so far
\pgfplotsset{
/pgfplots/pplots legend/.style={
legend image code/.code={
\draw[color=black] (0cm,0cm) to (0.6cm,0cm);
\draw[#1,color=black,mark repeat=1,mark phase=1]
plot coordinates {
(0.3cm,0cm)
};
}}}
failes due to a compile error:
Undefined control sequence. [...] \pgfplotsplothandlermesh@numpoints ->\numcoords
