# pgfplots: Set exponent of scientific number format for nodes near coords

As you can see, my plot currently has node labels with scale factors of both 10^6 and 10^5:

My goal is to specify a scale factor of 10^6 for every node label:

So my question is: How can I explicitly set the exponent in scientific number formatting?

\begin{tikzpicture}
\begin{axis}[
width=6cm,
xtick=\empty,
ybar,
ymin=0,
ymax=3e6,
bar width=1cm,
scaled y ticks=base 10:-6,
ymajorgrids,
nodes near coords={\pgfmathprintnumber[sci,precision=1]{\pgfplotspointmeta}}
]
\addplot+[orange] coordinates {(0, 2 500 000)};
\end{axis}
\end{tikzpicture}

-
–  Claudio Fiandrino Jan 31 '13 at 10:24

I'm not sure if you can get the PGF math parser to do this (might be a useful feature request), but you can use siunitx' \num macro, which has a fixed-exponent option:

\documentclass{report}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{siunitx}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=6cm,
xtick=\empty,
ybar,
ymin=0,
ymax=3e6,
bar width=1.4cm,
scaled y ticks=base 10:-6,
ymajorgrids,
nodes near coords={
\pgfmathfloattofixed{\pgfplotspointmeta} % Convert floating point to fixed point
\num[
scientific-notation = fixed,
fixed-exponent = 6,
round-mode = places,
round-precision = 1,
exponent-product=\cdot
]{\pgfmathresult}}
]