17

Hi i want to put this simbol "%" in the tick labels only in the x axis how can i do?enter image description here

19

You can use xticklabel=\pgfmathprintnumber{\tick}\,\%. xticklabel defines the code used for printing the tick labels, and \tick contains the current tick value.

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    xticklabel=\pgfmathprintnumber{\tick}\,\%
]
\addplot{rnd};
\end{axis}
\end{tikzpicture}
\end{document}
| improve this answer | |
  • 2
    since the tick labels are typeset using the maths fonts, if one uses a slightly different font due to using unicode-math, it might be more appropriate to use xticklabel=\pgfmathprintnumber{\tick}\(\,\%\). – ArTourter Jan 5 '13 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.