I have the following data:
[0.21, 0.21, 0.33, 0.52, 0.22, 0.35, 0.43]
I would like to do the following things:
I have the following data:
[0.21, 0.21, 0.33, 0.52, 0.22, 0.35, 0.43]
I would like to do the following things:
Part 2. of your question is simple enough to do - you just need to define the width of the bins by passing a list of the boundaries.
import matplotlib.pyplot as plt
X = [0.21, 0.21, 0.33, 0.52, 0.22, 0.35, 0.43]
plt.hist(X, bins=[0.0, 0.2, 0.4, 0.6])
plt.show()
This will create bins [0.0, 0.2), [0.2, 0.4), [0.4, 0.6] where '[' is inclusive and '(' is exclusive.
Not clear on what you require in part 1. of your question.
plt.hist".
ax.set_xticks.