On Fri, 2010-10-22 at 11:12 -0500, Ryan May wrote:
> On Fri, Oct 22, 2010 at 9:40 AM, Christopher Fonnesbeck
>
> > If there are only 7 possible values of the data, which are
> evenly-spaced, it should probably not go in and create more than 6
> bins as the default behavior. I know I can specify bins by hand, but
> when automated it would be nice to have a more sensible default.
> 
> It just defaults to creating 10 bins (which is identical to
> numpy.histogram, which is what does the work under the hood.) If you
> know how many bins you want, you can just do:
> 
> hist(x, bins=6)
> 
> This gives (for your example) the behavior you seem to want.  I don't
> know of any way that would sensibly choose a number of bins
> automatically, but I'd consider a patch that proves me wrong. :)

I'm moving on from IDL. From that background I used the Coyote library
quite a bit, and there I found:

   binsize = (3.5 * numpy.std(data)) / len(data)**(0.3333)

(from http://www.dfanning.com/programs/histoplot.pro known as Scott's
Choice of bin size for histograms).

>From the binsize and the range of the data, you then figure out an axis
for the histogram).

Maarten
-- 
KNMI, De Bilt
T: 030 2206 747
E: maarten.sn...@knmi.nl
Room B 2.42


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to