# Adding units to pgfplots nodes in column chart

The picture below is almost what I need and is generated by the MWE below. All I require is to include percentage symbols on the labels on the nodes. So they should read: 34%, 22% and 13%.

----------- MWE ---------------------

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
symbolic x coords={A,B,C},
nodes near coords,
xtick=data
]
(A,34)
(B,22)
(C,13)
};
\end{axis}
\end{tikzpicture}

\end{document}


By default nodes near coords prints \pgfmathprintnumber{\pgfplotspointmeta}. You can add a percent sign by saying

nodes near coords=\pgfmathprintnumber{\pgfplotspointmeta}\%


\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
symbolic x coords={A,B,C},
nodes near coords=\pgfmathprintnumber{\pgfplotspointmeta}\%,
xtick=data
]
(A,34)
(B,22)
(C,13)
};
\end{axis}
\end{tikzpicture}

\end{document}

• Very useful! This will go into my collection. – Dr. Manuel Kuehner May 20 '17 at 17:10

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
% https://tex.stackexchange.com/questions/350129
\begin{axis}[
symbolic x coords={A,B,C},
nodes near coords,
point meta=explicit symbolic,
xtick=data,
]