I am confused about the matplotlib hist function.
The documentation explains:
If a sequence of values, the values of the lower bound of the bins to be used.
But when I have two values in sequence i.e [0,1], I only get 1 bin. And when I have three like so:
plt.hist(votes, bins=[0,1,2], normed=True)
I only get two bins. My guess is that the last value is just an upper bound for the last bin.
Is there a way to have "the rest" of the values in the last bin, other than to but a very big value there? (or in other words, without making that bin much bigger than the others)
It seems like the last bin value is included in the last bin
votes = [0,0,1,2]
plt.hist(votes, bins=[0,1])
This gives me one bin of height 3. i.e. 0,0,1. While:
votes = [0,0,1,2]
plt.hist(votes, bins=[0,1,2])
Gives me two bins with two in each. I find this counter intuative, that adding a new bin changes the widthlimits of the others.
votes = [0,0,1]
plit.hist[votes, bins=2)
yeilds two bins size 2 and 1. These seems to have been split on 0,5 since the x-axis goes from 0 to 1.
How should the bins array be interpreted? How is the data split?