I'm having trouble with pgfplots using ybar. When I try:
\begin{tikzpicture}
\begin{axis}[height=4.5cm, width=8cm, ybar, axis x line=bottom, axis y line=left, grid=none, ytick={0,10,20}, xmin=0, xmax=7, xtick={1,...,6}, x axis line style=-]
\addplot+[ybar] plot coordinates {(1,16) (2,18) (3,23) (4,13) (5,16) (6,14)};
\end{axis}
\end{tikzpicture}
I get this:
Which isn't what I wanted, since 4 should have a height of 13.
Trying this:
\begin{tikzpicture}
\begin{axis}[height=4.5cm, width=8cm, ybar, axis x line=bottom, axis y line=left, grid=none, ytick={0,10,20}, xmin=0, xmax=7, xtick={1,...,6}, x axis line style=-]
\addplot+[ybar] plot coordinates {(1,16) (2,18) (3,23) (4,13) (5,16) (6,0)};
\end{axis}
\end{tikzpicture}
Gives this:
Am I doing something wrong? How come I can't get the bars to be the correct heights?
\documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ybar] \addplot+ plot coordinates {(1,16) (2,18) (3,23) (4,13) (5,16) (6,14)}; \end{axis} \end{tikzpicture} \end{document}