So I have a little problem. I have a data set in scipy that is already in the histogram format, so I have the center of the bins and the number of events per bin. How can I now plot is as a histogram. I tried just doing
bins, n=hist()
but it didn't like that. Any recommendations?
Best Answer
The object-oriented interface is also straightforward:
If you are using custom (non-constant) bins, you can pass compute the widths using
np.diff
, pass the widths toax.bar
and useax.set_xticks
to label the bin edges: