On Oct 22, 2010, at 9:13 AM, Ryan May wrote:
> 
> On Fri, Oct 22, 2010 at 8:47 AM, Christopher Fonnesbeck
> <statist...@me.com> wrote:
>> I notice that when the number of bins in a histogram is sparse, the spacing 
>> between the bins can be irregular. For example:
>> 
>> http://cl.ly/7e0ad7039873d5446365
>> http://cl.ly/c7cb20b567722928ac3c
>> 
>> Is there a way of normalizing this, and better, can the default behavior 
>> result in something more consistent (i.e. publication-quality)?
> 
> That looks like some bizarre rounding/truncation or something like it.
> Can you post an example (can just use made up data) that reproduces
> this? I've not seen this before, so I sense it's due to the specific
> data types you're passing in.

Here is a very simple example. The data are just a list of integers:

http://dl.dropbox.com/u/233041/histexample.py

and it results in an odd choice of intervals.

(array([863, 775,   0, 271,   0,  67,  23,   0,   0,   1]),
 array([ 0. ,  0.6,  1.2,  1.8,  2.4,  3. ,  3.6,  4.2,  4.8,  5.4,  6. ]),
 <a list of 10 Patch objects>)

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.

Thanks,
cf

------------------------------------------------------------------------------
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