I have a simple barchart, on the y axis i have values which are displayed full written (e.g. 5'000'000). I dont want to change the orginal data but change the y-axis lable into a fullwritten value e.g. "5 Mio."

Any Idea how to approach this target, I tried but couldn't find anything useful.The only thing I found is something for tables, and I think it should be possible whith barcharts as well, any hint ? I guess I need to have a temporary value which devides just the lable on the y-axis

cheers endo

  • 1
    It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Feb 17 '14 at 21:51
  • you're right, sry – endo.anaconda Feb 17 '14 at 23:12

You can scale all the tick labels by a common factor using scaled y ticks=base 10:-6 (dividing by 10^6). To switch off the scaling label, set ytick scale label code/.code={}. To add the word million after each label, set yticklabel={\pgfmathprintnumber{\tick} million}:


    scaled y ticks=base 10:-6,
    ytick scale label code/.code={},
    yticklabel={\pgfmathprintnumber{\tick} million}
\addplot {rand*1e7};

| improve this answer | |
  • 1
    bah, don't you have a phd or something? I'm typing very nicely and peacefully here :P – percusse Feb 17 '14 at 22:40
  • 1
    @percusse: Hehe! Actually, starting a "real" job in two weeks. PhD'ing isn't for me, it turns out. I see Word and Excel looming ahead... – Jake Feb 17 '14 at 22:41

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.