legend outside animation python code example Example: matplotlib savefig legend cut off fig.savefig('figure.png', bbox_inches='tight')