tikzplotlib icon indicating copy to clipboard operation
tikzplotlib copied to clipboard

Legend entries with underscores in labels not escaped correctly

Open GregoryMorse opened this issue 3 years ago • 1 comments
trafficstars

ax.plot([0,1,2], [0,1,2], label="a_b_c"); ax.legend()

Expected output: \addlegendentry{a\_b\_c}

Actual output: \addlegendentry{a_b_c} which will not compile in Latex.

GregoryMorse avatar Feb 19 '22 17:02 GregoryMorse

Neither are label entries with ampersand.

Expected output: \addlegendentry{a \& c}

Actual output: \addlegendentry{a & c} which also will not compile in LaTeX.

woalk avatar May 07 '22 12:05 woalk