I have some data, and I used SmoothHistogram to obtain a curve.

enter image description here

Now I would like to pick up several points on the curve such that I can fit this curve to a function. I get stuck with picking up points. Can anyone help me with this?

  • $\begingroup$ Post the code you used to generate the plot please. $\endgroup$
    – Bob Brooks
    Commented Nov 21, 2017 at 14:58
  • 1
    $\begingroup$ What function do you have in mind? I ask for two reasons: (1) If you have some particular probability density function in mind, you'd be better off using the original data and use maximum likelihood and (2) If you're considering a regression, note that the variance about the curve will not be equal across all values (which is usually the default assumption for most regression functions). $\endgroup$
    – JimB
    Commented Nov 21, 2017 at 15:46
  • 1
    $\begingroup$ If your raw data is in x, then you can generate a list of points with skd = SmoothKernelDistribution[x]; Table[{y, PDF[skd, y]}, {y, 0, 10, 0.01}] (but adjusting the y values to match what you need). That way you have explicit control as to the values of y that you want the pdf to be evaluated. $\endgroup$
    – JimB
    Commented Nov 21, 2017 at 15:50

1 Answer 1


If you just want the points, you can get them out of the Graphics object (remember that everything in Mathematica is a list of lists):

rands=RandomReal[1, 1000];
pts=SmoothHistogram[rands][[1, 2, 1, 3, 3, 1]]

ListPlot of the smoothed histogram points


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.