Matplotlib Bar Graph

PHOTO EMBED

Tue Sep 02 2025 04:25:12 GMT+0000 (Coordinated Universal Time)

Saved by @root1024 ##python #matplotlib

import matplotlib.pyplot as plt
plt.bar([0.25,1.25,2.25, 3.25, 4.25], [50,40,70,80,20],label="Science",width=0.5)
plt.bar([0.75, 1.75, 2.75, 3.75, 4.75],[80,20,20,50,60],label="Maths",width=0.5,color="r")
plt.legend()
plt.xlabel("Months---------------------->")
plt.ylabel("Subject-------------------->")
plt.title("Information")
plt.show()
content_copyCOPY

Bar Graph