I am testing a graph and everything except the legend works. I've run the code below without the label found in the plt.plot but I still don't get a legend returned. Can anyone see why?
plt.figure(figsize=(8,5))
plt.title('Test Graph', fontdict={'fontweight':'bold', 'fontsize': 24})
plt.plot(excl.Date, excl.Pop2020, 'g.-', label = 'test')
plt.xticks(excl.Date[::4])
plt.xlabel('Date')
plt.ylabel('Pop')
plt.legend
plt.savefig('testpic.png', dpi = 300)
plt.show()