1

Possible Duplicate:
How do you remove the axis multiplier?

I have a problem getting fixed (as opposed to scientific) number formatting on my axes in PGFPlots. The following example:

\documentclass[a4paper]{article}

\usepackage{pgfplots}

\begin{document}

\pgfplotstableread{
     b     b1         years  
    .1    .01         1  
    .2    .02         2  
}{\estimates}

\begin{tikzpicture}
    \begin{axis}[
        yticklabel style={/pgf/number format/fixed},
        ]      
        \addplot table[x=years,y=b1]{\estimates};
    \end{axis}
\end{tikzpicture}

\begin{tikzpicture}
    \begin{axis}[
        yticklabel style={/pgf/number format/fixed},
        ]      
        \addplot table[x=years,y=b]{\estimates};
    \end{axis}
\end{tikzpicture}

\end{document}

Produces the following output:

Code output

Notice that for the first graph, I have scientific notation, even though I specified the option yticklabel style={/pgf/number format/fixed}, while in the second graph this works as it should. If I give an option like yticklabel style={/pgf/number format/.cd,fixed,precision=3} to the first graph, I get this error message:

! Package pgfkeys Error: I do not know the key '/pgf/number format/at' and I am
 going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.24         \end{axis}


! Package pgfkeys Error: I do not know the key '/pgf/number format/anchor' and 
I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.24         \end{axis}


! Package pgfkeys Error: I do not know the key '/pgf/number format/inner sep' a
nd I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.24         \end{axis}

but giving the same option to the second graph works fine.

After some further testing, it seems that this problem appears when the y values are below 0.1 and above 0, or below 0 and above -0.1. The same goes for the x axis.

Is this a bug in PGFPlots, or am I doing something wrong? I have version 1.7, running MikTex 2.9 on Windows, all packages updated today.

  • 1
    You have to set scaled y ticks = false to prevent PGFPlots from dividing the ticks by a common factor. See tex.stackexchange.com/questions/9803/…. – Jake Nov 15 '12 at 14:26
  • Excellent! If you don't mind, we'll close this question as a duplicate of the other one so people can find the answer more easily? – Jake Nov 16 '12 at 9:45
  • Sure, that seems like a good idea. – standard_error Nov 16 '12 at 10:31

Browse other questions tagged or ask your own question.