Machine Learning courses with 110+ Real-time projects Start Now!!
Program 1
import matplotlib.pyplot as mat
x=[0,1,2,3,4,5]
y=[0,1,4,9,16,25]
y1=[0,10,20,30,40,50]
y2=[0,14,26,38,42,58]
#mat.plot(x,y,marker='.',mfc='y',mec='k',ms=10,ls="solid",lw=2,c='r')
#mat.plot(x,y,x,y1)
#mat.legend(['Sales','Product'])
mat.plot(x,y,marker='.',mfc='y',mec='k',ms=10,ls="solid",lw=2,c='r',label='Sales')
mat.plot(x,y1,marker='.',mfc='r',mec='k',ms=10,ls="solid",lw=2,c='b',label='Product')
mat.plot(x,y2,marker='.',mfc='g',mec='k',ms=10,ls="solid",lw=2,c='k',label='Company')
#mat.legend(loc=10)
mat.legend(loc='upper left',facecolor='yellow',edgecolor='red',framealpha=0.5,shadow=True,fancybox=True)
#mat.legend(loc='upper right')
#mat.legend(loc='lower left')
#mat.legend(loc='lower right')
fc={'family':'Times New Roman','size':20,'color':'r'}
fc1={'family':'Times New Roman','size':25,'color':'g'}
fc2={'family':'Verdana','size':30,'color':'b'}
mat.xlabel("X-Axis",fontdict=fc)
mat.ylabel("Y-Axis",fontdict=fc)
mat.title("Line Chart",fontdict=fc2)
mat.show()