Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've been trying to figure out how to change the chart from scientific notation to just show the 5 digit numbers. I've tried scale and scale ticks with not success.

How can I change the y-axis and data values to show the decimals not in scientific notation?

\begin{tikzpicture}
\centering
\begin{axis}[
    width=300pt,
    height=250pt,
    axis lines*=left, % Don't display the top and right lines
    ybar, % Display it as a bargraph
    enlarge y limits={upper,value=0.2},
    legend style={at={(0.5,-0.20)}, % -.20 y-axis
    anchor=north,legend columns=-1},
    ylabel={Densities},
    nodes near coords,
    every node near coord/.append style={ anchor=mid west, rotate=90},
    symbolic x coords={Class1,Class3,Class5,Class7,Class9,Class11,Class13,Class15,Class17,Class19,Class21,Class23},
    xtick=data,
    xticklabel style={ inner sep=0pt, anchor=north east, rotate=70 },
    nodes near coords align={vertical},
]
\addplot coordinates { (Class1,0.0968) (Class3,0.0887) (Class5,0.1452) (Class7,0.0726)
    (Class9,0.0403) (Class11,0.0081) (Class13,0.0161) (Class15,0.0000)
    (Class17,0.0161) (Class19,0.0081) (Class21,0.0000) (Class23,0.0081) };
\end{axis}
\end{tikzpicture}
share|improve this question

1 Answer 1

up vote 8 down vote accepted

You can use yticklabel style={/pgf/number format/fixed}:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\centering
\begin{axis}[
    width=300pt,
    height=250pt,
    axis lines*=left, % Don't display the top and right lines
    ybar, % Display it as a bargraph
    enlarge y limits={upper,value=0.2},
    legend style={at={(0.5,-0.20)}, % -.20 y-axis
    anchor=north,legend columns=-1},
    ylabel={Densities},
    nodes near coords,
    every node near coord/.append style={ anchor=mid west, rotate=90},
    symbolic x coords={Class1,Class3,Class5,Class7,Class9,Class11,Class13,Class15,Class17,Class19,Class21,Class23},
    xtick=data,
    xticklabel style={ inner sep=0pt, anchor=north east, rotate=70 },
    nodes near coords align={vertical},
  yticklabel style={/pgf/number format/fixed},
]
\addplot coordinates { (Class1,0.0968) (Class3,0.0887) (Class5,0.1452) (Class7,0.0726)
    (Class9,0.0403) (Class11,0.0081) (Class13,0.0161) (Class15,0.0000)
    (Class17,0.0161) (Class19,0.0081) (Class21,0.0000) (Class23,0.0081) };
\end{axis}
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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