I have some data I want to plot in a bar chart where the name on the x-axis should have a % sign in it. So this works:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar,
symbolic x coords={10 perc,20 perc},
]
\addplot coordinates {(10 perc,10) (20 perc,20)};
\end{axis}
\end{tikzpicture}
\end{document}
But if I try something like:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar,
symbolic x coords={10\%,20\%},
]
\addplot coordinates {(10\%,10) (20\%,20)};
\end{axis}
\end{tikzpicture}
\end{document}
I get the following error:
ERROR: Missing \endcsname inserted.
--- TeX said ---
<to be read again>
\%
l.8 ]
This happens in and out of math mode.
\\\% causes pdflatex to hang.
Thanks in advance!