I have a vector containing values and I would like to draw a probability density function (PDF) graph for the values contained. Let's say I have a vector given by b=[1,1,3,4,5,2,3,5,1,4,2,4,1,1,4,2,3,5]
. I can draw a histogram as follows
cghistoplot, b, binsize=1, xtitle='values', ytitle='freq', /fill
However, I want to draw the pdf using a line plot, i.e. I want y values to be normalized by the number of values in the vector (18 here). I know I can use cgplot
to make line plots, but it needs x- and y-values.