add legend matplotlib fig code example
Example 1: plt.legend(
plt.legend(['first', 'second']);
Example 2: legend matplotlib
import matplotlib.pyplot as plt
#define x and ysin
plt.plot(x,ysin,label='sin(x)')
plt.legend()
plt.show()
plt.legend(['first', 'second']);
import matplotlib.pyplot as plt
#define x and ysin
plt.plot(x,ysin,label='sin(x)')
plt.legend()
plt.show()