我正在尝试制作直方图,到目前为止我已经达到以下代码,请您帮助我,问题出在哪里以及我该如何完成这项任务?
这是 MWE。
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis on top,
scale only axis,
xmode=number,
ymode=number,
ybar interval,
x tick label as interval=false,
xtick={},
xtickten={117.5, 126.5,135.5,144.5,153.5,162.5,171.5,180.5},
yticklabel={},
xmin=0, xmax=180.5,
ymin=0,ymax=16,
grid=none,
ymajorgrids,
log origin=infty
]
\addplot [fill=gray!50] table [x=Lower, y=Count] {
Lower Upper Count
117.5 126.5 4
126.5 135.5 6
135.5 144.5 10
144.5 153.5 12
153.5 162.5 4
162.5 171.5 3
171.5 180.5 1
};
\end{axis}
\end{tikzpicture}
\end{document}