Matplotlib
import matplotlib.pyplot as plt
import numpy as np
x = np.array([1,2,3,4])
y = np.array([1,3,4,2])
tfont = {'family' : 'serif' , 'color' : '#50CB1E', 'size' : 15 }
xfont = {'family' : 'fantasy' , 'color' : "#3C871D" , 'size' : 15 }
yfont = {'family' : 'fantasy' , 'color' : "#3C871D" , 'size' : 15 }
plt.title("My graph", loc = 'left' , fontdict = tfont)
plt.xlabel("X-axis", fontdict = xfont)
plt.ylabel("Y-axis" , fontdict = yfont)
plt.grid(color = '#D3E05B', linewidth = 0.7, linestyle = '--')
plt.plot(x, y, marker ="h", ms= 10, mec = "#000000",mfc = "#A91ECB", ls = "dashed", linewidth = '3', color = "#16E0E0")
plt.show()
#comparison of two graphs
a = np.array([2,3,7,8])
b = np.array([8,9,5,4])
plt.scatter(a,b , s = 30)
a = np.array([8,7,5,8])
b = np.array([9,8,6,4])
plt.scatter(a,b , s = 40 , alpha = 0.5)
plt.show()
Comments
Post a Comment