I’m using matplotlib to make a histogram.
Is there any way to manually set the size of the bins as opposed to the number of bins?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually, it’s quite easy: instead of the number of bins you can give a list with the bin boundaries. They can be unequally distributed, too:
If you just want them equally distributed, you can simply use range:
Added to original answer
The above line works for
datafilled with integers only. As macrocosme points out, for floats you can use: