D White wrote:
> I'm having no luck getting the "bins" option to pylab.hist() to work.
> Here's an example:
>
> fish_data=[random() for i in range(100)]
> import pylab
> import numpy
>
> divats = numpy.arange(0.0,1.0,0.1)
> pylab.hist(fish_data, bins=divats)
> pylab.savefig('sage.png')
>
You can do lots of things to solve this problem. The easiest is to wait
for the next Sage release, which contains a fix for this (longstanding)
problem.
To get things to work now, the easiest thing to do is to declare divats
to be of float type:
divats = numpy.arange(0.0, 1.0, 0.1, dtype=float)
(or use William's trick...)
Jason
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---