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