set legend as axis in matplotlib code example
Example 1: set axis labels python
plt.xlabel("X axis label")
plt.ylabel("Y axis label")
plt.plot(range(5))
plt.xlabel("X axis label")
plt.ylabel("Y axis label")
plt.title("Figure title", fontsize = 20)
Example 2: matplotlib add legend axis x
fig = plt.figure(figsize=(10,5))
ax = fig.add_subplot(111)
ax.set_title('ADR vs Rating (CS:GO)')
ax.scatter(x=data[:,0],y=data[:,1],label='Data')
plt.plot(data[:,0], m*data[:,0] + b,color='red',label='Our Fitting
Line')
ax.set_xlabel('ADR')
ax.set_ylabel('Rating')
ax.legend(loc='best')
plt.show()