Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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 at 14:26
    
or perhaps DistributionChart[data,BarOrigin->Left]. See:reference.wolfram.com/mathematica/ref/DistributionChart.html –  ubpdqn Mar 9 at 14:38

1 Answer 1

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

 
discard

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.