7

I'm doing a horizontal bar chart, but in my x axis and in the number in each bar is exponential and I want a "normal" number. How can I do that?

\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}[
xbar,
width=12cm, height=6cm, enlarge y limits=0.2,
xlabel={total de edifícios certificados},
xticklabel style={/pgf/number format/fixed},
symbolic y coords={HQE, BREEAM, LEED, DGNB, Green Star, Living Building},
ytick=data,
nodes near coords, nodes near coords align={horizontal},
]
\addplot coordinates {(266000,HQE) (250000,BREEAM)(51700,LEED)(834,DGNB)(256,Green Star)(192,Living Building)};
\end{axis}
\end{tikzpicture}
  • Does this question help? http://tex.stackexchange.com/q/96347/32374 – darthbith Oct 30 '14 at 17:47
  • Welcome to TeX.SE. For future reference, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Oct 30 '14 at 17:49
  • darthbirth, not really. This question is all about the axis, while my problem envolves also the numbers on the side of the bars. See my last comment bellow Peter's answer. – Janayna Olenick Oct 30 '14 at 18:14
  • @JanaynaOlenick As you can see, the same information is needed, just put in a different place :-) Glad Peter was able to help! – darthbith Oct 30 '14 at 18:20

1 Answers1

9

Use scaled x ticks=false to remove the scaling on the x axis. If you also want to elimiante the scaling on the labels for the bars you can use every node near coord/.style={/pgf/number format/fixed}:

enter image description here

Notes:

  • I also added xmax=310000 to get the numbers within the box.

Code:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\begin{document}

\begin{tikzpicture} \begin{axis}[ xbar, width=12cm, height=6cm, enlarge y limits=0.2, xlabel={total de edifícios certificados}, xticklabel style={/pgf/number format/fixed}, symbolic y coords={HQE, BREEAM, LEED, DGNB, Green Star, Living Building}, ytick=data, nodes near coords, nodes near coords align={horizontal}, scaled x ticks=false, every node near coord/.style={/pgf/number format/fixed}, xmax=310000, ] \addplot coordinates {(266000,HQE) (250000,BREEAM)(51700,LEED)(834,DGNB)(256,Green Star)(192,Living Building)}; \end{axis} \end{tikzpicture} \end{document}

Peter Grill
  • 223,288