Я видел несколько примеров создания легенд через доступ к осям, но не смог применить их к своему сюжету. Я создаю подсюжеты с командой subplots = True, а не вручную. Как я могу объединить легенды в одну?
![enter image description here](https://i.stack.imgur.com/5HlEa.png)
Это то, что я пытался, но я не уверен, как получить доступ к осям. Любая помощь приветствуется.
fig=plt.figure()
table=grouped.pivot_table(values='AverageTemperatureCelsius',index='year', columns='Country')
ax=table.plot.line(subplots=True, grid=True,layout=(3, 3), sharex=True, legend=False,ylim=[-5,25])
line_labels = ['Brazil', 'France', 'Japan', 'New Zeland','Poland','South Africa','Sweden','Ukraine']
fig.legend(ax, # The line objects
labels=line_labels, # The labels for each line
loc="center right", # Position of legend
borderaxespad=0.1, # Small spacing around legend box
title="Legend Title" # Title for the legend
)