3

I'm wondering how to disable scietific notation in lables of ybar. here is the tex code:

\begin{axis}
 [width=6cm, height=6cm,  
        yticklabel style={/pgf/number format/fixed},
    ybar=5pt,
        ylabel=Cost,
    x=2cm,
    ymin=0,
    xtick=data,
        nodes near coords,
        every node near coord/.append style={ anchor=mid west, rotate=90},
    symbolic x coords={A,B,C,D,E},
    axis lines*=left,
    ]
\addplot coordinates { (A,12398) (B,31814) (C,30833) (D,72290) (E,9078)}; %Greedy
\end{axis}
\end{tikzpicture}
\end{figure}

And the chart...

Sali Hoo
  • 133

1 Answers1

4

You can use scaled y ticks=false:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}

\begin{tikzpicture}
\begin{axis}
 [width=6cm, height=6cm,  
    ybar=5pt,
        ylabel=Cost,
    x=2cm,
    ymin=0,
    xtick=data,
        nodes near coords,
        every node near coord/.append style={ anchor=mid west, rotate=90},
    symbolic x coords={A,B,C,D,E},
    axis lines*=left,
        scaled y ticks=false,
    ]
\addplot coordinates { (A,12398) (B,31814) (C,30833) (D,72290) (E,9078)}; %Greedy
\end{axis}
\end{tikzpicture}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128