Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list of points, that may have clusters in some of the $x$ axis values, and my goal is to get a function that shows that graphically.

Something like this, but the red function is "hand drawn", it's just for reference.

frequency plot

The high points of the red plot shows where the clusters are and the low points where are the points that are most isolated.

share|improve this question
I think you can just plot the points in front of their Histogram or SmoothHistogram. – Kuba Mar 9 '14 at 14:26
or perhaps DistributionChart[data,BarOrigin->Left]. – ubpdqn Mar 9 '14 at 14:38
values = Transpose[{Join[
     RandomVariate[NormalDistribution[1.5, 0.3], 100], 
     RandomVariate[NormalDistribution[3.5, 0.3], 100]], 
    RandomVariate[NormalDistribution[1.5, 0.1], 200]}];
Overlay[{ListPlot[values, PlotRange -> {{0, 5}, {0, 2}}, 
   ImagePadding -> 25], 
  SmoothHistogram[values[[All, 1]], Axes -> False, 
   PlotRange -> {{0, 5}, {0, All}}, ImagePadding -> 25]}]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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