I have a set of random data. I could easily make a histogram in Mathematica as
Then I tried to replot this histogram in latex using the pgfplots package. But I only got
The important thing that was lost in this plot is the number of data within each bar. I don't know how can I do that. I need help to
- place those numbers on each bar
- insert more bars as it was made in the Mathematica.
The data file can be downloaded from here and here is my latex code for the histogram
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.17}
\usepgfplotslibrary{statistics}
\begin{document}
\begin{tikzpicture}
\begin{axis}[small,ymin=0,title=\texttt{Histogram}]
\addplot [
hist,
fill=orange!75,
draw=orange!50!black]
table [y index=0] {data.dat};
\end{axis}
\end{tikzpicture}
\end{document}
