What is the use of legend() function in matplotlib? code example
Example: legend matplotlib
import matplotlib.pyplot as plt
#define x and ysin
plt.plot(x,ysin,label='sin(x)')
plt.legend()
plt.show()
import matplotlib.pyplot as plt
#define x and ysin
plt.plot(x,ysin,label='sin(x)')
plt.legend()
plt.show()