MathGroup Archive 2009

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

Search the Archive

Re: Re: Re: How to get data from Histogram


On Mar 13, 2009, at 4:48 AM, Jozef Pulko wrote:

> Thanks for answers, but this didn't solved my problem...
>
> I was trying to get data like it is described in these example...
>
> But this only works if I chose interval and step for histogram. I  
> was not
> able to get data out of histogram when letting Mathematica  
> automatically
> chose step and interval for building the histogram.
>

This will use the automatic bin selection, and return the bins and  
their counts:

{g, {binCounts}} =
   Reap[Histogram[
     RandomReal[NormalDistribution[0, 1], 100], Automatic,
     Function[{bins, counts}, Sow[{bins, counts}];counts]]];

Brett Champion
Wolfram Research


> Jozef
>
> -----Original Message-----
> From: DrMajorBob [mailto:btreat1 at austin.rr.com]
> Sent: Donnerstag, 12. M=E4rz 2009 11:43
> To: mathgroup at smc.vnet.net
> Subject: [mg97425] [mg97409] Re: [mg97367] How to get data from  
> Histogram
>
> Help has the following example:
>
> {g, {binCounts}} =
>   Reap[Histogram[
>     RandomReal[NormalDistribution[0, 1], 100], {-2, 2, 0.25},
>     Function[{bins, counts}, Sow[counts]]]];
>
> binCounts
>
> {{3, 4, 5, 6, 11, 3, 12, 6, 5, 13, 7, 4, 10, 2, 3, 2}}
>
> Bobby
>
> On Thu, 12 Mar 2009 02:15:57 -0500, Jozef Pulko
> <jozef.pulko at googlemail.com> wrote:
>
>> HI to all,
>>
>> i am using Mathematica 7.0.0.
>>
>> what I would like to do is to somehow get data out of histogram
>> generated by
>> Histogram[].
>>
>> For an example:
>>
>> I tried to do find the frequency of my data with BinCounts[]... but I
>> need
>> to manually chose binsize an binwindow.
>>
>> By using Histogram[] the binsize and binwindow are chosen  
>> automatically
>> with
>> smart algorithms, but only plotted. is there any way to get data  
>> out of
>> plotted histogram?
>>
>> Thnx,
>>
>> Jozef
>>
>>
>
>
>
> --
> DrMajorBob at bigfoot.com
>



  • Prev by Date: Mathematica Question - Using DSolve with Boundary Conditions
  • Next by Date: Re: ListPointPlot3D not composable?
  • Previous by thread: Re: Re: How to get data from Histogram
  • Next by thread: Re: How to get data from Histogram