I'm trying to place the legend in the space underneath a matplotlib plot. I'm creating each subplot with a unique identifier then using plt.figure() to adjust the size of the plot. When I specify a plot size, the space around the plot disappears (the PNG tightens the layout around the plot). Here's my code:
fig = plt.subplot(111)
plt.figure(111,figsize=(3,3))
plots = []
legend = []
#fig.set_xlim([0, 20])
#fig.set_ylim([0, 1])
#ticks = list(range(len(k_array)))
#plt.xticks(ticks, k_array)
plt.plot(k_array, avgNDCG, 'red')
legend.append("eco overall F1")
if data_loader.GSQb:
legend.append("GSQ F1")
plt.plot(k_array, avgGSQNDCG, 'orange')
if data_loader.BSQb:
legend.append("BSQ F1")
plt.plot(k_array, avgBSQNDCG, 'purple')
if data_loader.GWQb:
legend.append("GWQ F1")
plt.plot(k_array, avgGWQNDCG, 'black')
if data_loader.BWQb:
legend.append("BWQ F1")
plt.plot(k_array, avgBWQNDCG, 'green')
if data_loader.GAQb:
legend.append("GAQ F1")
plt.plot(k_array, avgGAQNDCG, 'blue')
fig.legend(legend, loc='center', bbox_to_anchor=(0, 0, .7, -2),fontsize='xx-small')
plt.savefig("RARE " + metaCat + " best avg NDCG scores")
When I comment out plt.figure(111,figsize=(3,3)), the white space underneath and around the plot is visible:

But when I uncomment it:
Please help me understand how I can modify the plotsize, legend and layout spacing to make it look more like 1 but with a bigger plot.

