Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: Strange Result from Histogram in V6

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83306] Re: Strange Result from Histogram in V6
  • From: Norbert Marxer <marxer at mec.li>
  • Date: Sat, 17 Nov 2007 05:20:31 -0500 (EST)
  • References: <fhjs1s$4qn$1@smc.vnet.net>

On 16 Nov., 11:39, Scott <sguth... at gmail.com> wrote:
> The command:
>
> Histogram[{1/4, 1/3, 1/2, 1/4, 1, 1/4, 1/2, 1/3, 1/4},
> HistogramCategories -> {0, 1/4, 1/3, 1/2, 1, 2}]
>
> seems to find 48 values between 0 and around .2 and 12 values between
> around .2 and .5 in Version 6.
>
> Very strange.
>
> Any insight?
>
> Cheers, Scott

Hello

Note that the default setting for HistogramScale is Automatic, which -
for unequally sized intervals - behaves in the same way as
HistogramScale->True. As you can read in the documentation center:

HistogramScale -> False does not scale the bar heights and therefore
gives the number of measurements for each interval.
HistogramScale -> True scales the bar heights by the interval width.
HistogramScale -> 1 gives a probability density plot.

I would also use HistogramRange->{0,2}. Then you can see better that
the first interval [0,1/4] is empty.

Without scaling:
Histogram[{1/4, 1/3, 1/2, 1/4, 1, 1/4, 1/2, 1/3, 1/4},
HistogramCategories -> {0, 1/4, 1/3, 1/2, 1, 2}, HistogramRange -> {0,
2}, HistogramScale -> False]

With scaling:
Histogram[{1/4, 1/3, 1/2, 1/4, 1, 1/4, 1/2, 1/3, 1/4},
HistogramCategories -> {0, 1/4, 1/3, 1/2, 1, 2}, HistogramRange -> {0,
2}, HistogramScale -> True]

You get the number 48, because you have 4 measurements in the interval
[1/4,1/3[ with a width of 1/12.

Best Regards
Norbert Marxer


  • Prev by Date: Re: Does ColorFunction-> have different meanings to Plot3D and
  • Next by Date: Re: Does ColorFunction-> have different meanings to Plot3D and
  • Previous by thread: Re: Strange Result from Histogram in V6
  • Next by thread: RegionPlot ignores the AxesLabel Option?