The following code with the comma in the legend entry fails to compile.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend entries = {$a, b$} , %<- error!
title = {$a, b$},
xlabel = {$a, b$}
]
\addplot {x};
\end{axis}
\end{tikzpicture}
\end{document}
I have added additional curly brackets around the expression as needed by tikz (e.g. here Comma in the formula in tikz).
Weird enough, the error only seems to appear, when using a comma in the legend, as labels and titles work fine.
Is this a bug in the parser or am I missing something?