python - Matplotlib Histogram not showing graph properly -


i have list of timestamp in format: datetime.datetime(2016, 5, 10, 6, 54, 46, 535000) day.

i want create histogram every 15mins in day i.e.e 00:00-00:15, 00:15-00:30,00:30-00:45 etc. in there 96 bins (24 hrs*4 bins).

this code:

plt.figure(figsize=(100, 200)) plt.title('shift distribution', fontsize=20) plt.xlabel('time', fontsize=15) plt.ylabel('number of shipments', fontsize=15) plt.xticks(rotation=90, fontsize='small') plt.hist(x_data, bins=96) plt.show() 

but getting:

histogram

my objective histogram starts time 00:00 , having range of 15mins , hence spanning out till 23:59. idea how such format.

by default, hist scales bins' range minimum , maximum of data. according the hist api, can change passing in range keyword argument, e.g., range=[beginningofday, endofday]; beginningofday , endofday have in same format data, believe.


Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file -