Я пытаюсь вывести свою легенду за пределы сюжета, но некоторые из них обрезаются.
Мои данные:
Origin China India Pakistan Philippines United Kingdom of Great Britain and Northern Ireland
Year
1980 5123 8880 978 6051 22045
1981 6682 8670 972 5921 24796
1982 3308 8147 1201 5249 20620
1983 1863 7338 900 4562 10015
1984 1527 5704 668 3801 10170
Мой код:
top_5.plot(kind = 'line', figsize=(10, 6)).legend(loc='center left', bbox_to_anchor=(1, 0.5))
plt.title('Top 5 Countries in Terms of Origin of Immigrants to Canada')
plt.xlabel('Year')
plt.ylabel('Number of Immigrants')
plt.show()
Выход:

Ваш совет будет оценен.