Skip to main content

Draw a Bar Graph using Python Matplotlib

    Draw a Bar Graph using Python Matplotlib

Code : 

import numpy as np
from matplotlib import pyplot as plt

x=[1,2,3,4,5]
print(x)
y = [1,1,3,6,1]
print(y)
plt.plot(x,y,"ob")
plt.bar(x,y)
plt.show()

Output :

Comments