Last active
January 8, 2021 19:39
-
-
Save mdnurahmed/83e9ab9bd72be766e4beb4af85aaed19 to your computer and use it in GitHub Desktop.
Generating the bar chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
dates = [] | |
mins = [] | |
for i in range(0,len(mylist)): | |
dates.append(mylist[i][0]) | |
mins.append(int(mylist[i][1]/60)) | |
#xcordinates of the bars | |
xpos = np.arange(len(dates)) | |
#setting labels of xcordinates of the bars | |
plt.xticks(xpos,dates) | |
plt.bar(xpos,mins) | |
#putting values of bars as label on top of the bar | |
for i in range(0,len(mins)): | |
plt.text(xpos[i]-0.075 , mins[i] + 3, str(mins[i]), color='red') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment