MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Probability Histogram Problems

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108569] Probability Histogram Problems
  • From: Don <donabc at comcast.net>
  • Date: Wed, 24 Mar 2010 04:40:11 -0500 (EST)

I would like to have probability  histograms that have the same
minimum and maximum bin end points
for easy comparison of histograms across multiple data sets.  I want
to be able to explicity control the end points of the histogram, even
if there is
no data in the minimum and maximum bins.

For example,  here is a probabilty histogram with min bin end point of
-.4
and maximum bin end point of .4 (and a bin size of 0.1)

minBinEndPt = -.4;
maxBinEndPt = .4;
binSize = .1;
data = {-0.21`, -0.2`, -0.19`, -0.1`, -0.05`, 0.21`, 0.2`, 0.19`,
   0.1`, 0.05`};

Histogram[data, {binSize}, "Probability",
 PlotRange -> {{minBinEndPt, maxBinEndPt}, Automatic},
 AxesOrigin -> {minBinEndPt, 0}]

I would like to  improve this probablity histogram in
two ways:

(1) Have each one of the bin end points labeled and not just every
other one which is how it looks in the graph now.

(2) Label on top of each bar the exact height of the bar (the
probability).  These labels
for the probability histogram above may be calculated from:

topBarLabels =
 N[BinCounts[data, {minBinEndPt, maxBinEndPt, binSize}]  /
   Length[data]]

But how does one get the topBarLabels to be at the top of each
respective
bar in the histogram above?

Thank you in advance.


  • Prev by Date: Re: Calling kernel.dll from
  • Next by Date: Re: Tube plot function in Mathematica???
  • Previous by thread: Re: Calling kernel.dll from
  • Next by thread: Re: Probability Histogram Problems