matplotlib subplot

Matplotlib Subplot 0

Matplotlib Subplot

Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[0,1,4,9,16,25] x1=[10,20,30,40,50] y1=[10,30,20,50,40] x2=[100,200,300,400,500] y3=[100,400,300,500,200] mat.subplot(3,1,1) mat.plot(x,y,marker=”o”,mec=’k’,mfc=’r’,ms=10,ls=”solid”,lw=5,c=’b’,label=’Product1 ‘) mat.plot(y1,x1,marker=”o”,mec=’r’,mfc=’k’,ms=10,ls=”solid”,lw=5,c=’g’,label=’Product 2′) mat.xlabel(“X-Product”) mat.xlabel(“Y Product”) mat.title(“Product”) mat.legend() mat.subplot(3,1,2) mat.plot(x1,y1,marker=”o”,mec=’y’,mfc=’k’,ms=10,ls=”solid”,lw=5,c=’r’,label=’Sales’) mat.xlabel(“X-Sales”) mat.xlabel(“Y-Sales”) mat.title(“Sales”) mat.legend() mat.subplot(3,1,3) mat.plot(x1,y1,marker=”o”,mec=’y’,mfc=’k’,ms=10,ls=”solid”,lw=5,c=’r’,label=’Company’) mat.xlabel(“X-Company”) mat.xlabel(“Y-Company”) mat.title(“Company”) mat.legend()...

Python Matplotlib Program for Subplot 0

Python Matplotlib Program for Subplot

Program 1 import matplotlib.pyplot as mat x=[0,1,2,3,4,5] y=[0,1,4,9,16,25] x1=[0,10,20,30,40,50] y1=[0,20,10,40,10,50] x2=[0,10,20,30,40,50] y2=[0,20,10,40,10,50] x3=[0,10,20,30,40,50] y4=[0,20,10,40,10,50] mat.subplot(3,2,1) mat.plot(x,y,marker=’.’,mfc=’r’,mec=’k’,ms=10) mat.subplot(3,2,2) mat.plot(x1,y1,marker=’.’,mfc=’y’,mec=’r’,ms=10) mat.subplot(3,2,3) mat.plot(x2,y1,marker=’.’,mfc=’y’,mec=’r’,ms=10) mat.subplot(3,2,4) mat.plot(x3,y4,marker=’.’,mfc=’y’,mec=’r’,ms=10) mat.title(“Line Chart of SubPlot”) mat.xlabel(“X-Axis”) mat.ylabel(“Y-Axis”) mat.show()