Variations on this question have been asked multiple times before, but I have been unsuccessful in getting them to work. I may be (and most likely am) just inept at statistics.
I wish to plot a normal curve on top of this histogram using the data contained in the CSV file.
Many answers I have seen create a normal/gauss function, but I have excluded this from the MWE in case there is another, simpler way to do it.
Any assistance would be appreciated!
MWE:
\begin{filecontents*}{data.csv}
A
2
3
4
2
3
4
5
6
9
9
1
\end{filecontents*}
\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{filecontents}
\usepackage{pgfplotstable}
\begin{document}
\begin{tikzpicture}
\centering
\begin{axis}[
ybar interval,
/pgf/number format/.cd,
use comma,
1000 sep={},
title={Title},
xlabel={X Label},
ylabel={Y Label},
x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
y label style={at={(axis description cs:0.05,0.5)},anchor=south},
xticklabel style={rotate=90, anchor=near xticklabel},
ytick distance=2,
width=\textwidth, %10.5cm
height=6cm,
ymin=0
]
%%%
\addplot +[
black,
fill=lightgray,
hist={bins=5,
data min=0,
data max=10,
}
] table[y=A, col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}
\end{document}