I am trying to plot a histogram using the code below:
plt.subplots(figsize = (10,6))
lbins=[0,85,170,255,340,425]
plt.hist(flt_data[‘tree_dbh’], bins=lbins)
plt.gca().set(title=’Tree diameter histogram’, ylabel=’Frequency’)
The output is not including all data in the histogram.
The following are the descriptive statistics of the column:
>Solution :
It looks like all your data is in the the first bar. It’s not that the bars or missing it’s just that their values are very small compared to the first one.
You have 652173 point values and with a mean value of 11.7 and a std of 8.6. This means that the maximum value which is 425 is most likely an outlier.
Try doing it with:
lbins = np.arange(0,100, 10)
also you can take a look at len(flt_data['tree_dbh'][flt_data['tree_dbh'] > 85]) it will inform you how many points are counted in the other bars that you don’t see

