import matplotlib.pyplot as plt
x=[1,2,3,4]
y=[3,4,5,6]
plt.bar(x,y)
plt.show()
import matplotlib.pyplot as plt
x=[1,2,3,4]
y=[3,4,5,6]
c=['r','c','y','k']
plt.bar(x,y,color=c)
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
c=['r','c','y','k']
plt.bar(x,y,color=c)
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
c=['r','c','y','k']
plt.bar(x,y,color=c,width=0.5)
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(x,y,color='y',width=0.5,align='edge') # or align='center'
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(x,y,color='y',width=0.5,edgecolor='red')
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(x,y,color='y',width=0.5,edgecolor='red',linewidth=5,linestyle=":")
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(x,y,color='y',width=0.5,edgecolor='red',linewidth=5,linestyle=":",alpha=0.4)
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(x,y,color='y',width=0.5,edgecolor='red',label="letters")
plt.legend()
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
z=[4,3,2,1]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(x,y,color='y',width=0.5,label="letter")
plt.bar(x,z,color='r',width=0.5,label="words")
plt.legend()
plt.show()
import matplotlib.pyplot as plt
import numpy as np
x=['a','b','c','d']
y=[3,4,5,6]
z=[4,3,2,1]
width=0.2
p=np.arange(len(x))
p1=[j+width for j in p]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
plt.bar(p1,y,width,color='y',label="letter")
plt.bar(p,z,width,color='r',label="words")
plt.xticks(p+width/2,x,rotation=40)
plt.legend()
plt.show()
import matplotlib.pyplot as plt
x=['a','b','c','d']
y=[3,4,5,6]
z=[4,3,2,1]
plt.xlabel('alpha',fontsize=10)
plt.ylabel('values',fontsize=10)
plt.title('Graph',fontsize=10)
width=0.5
plt.barh(x,y,width,color='y',label="letter")
plt.barh(x,z,width,color='r',label="words")
plt.legend()
plt.show()