The legend is cut off if you do fig.savefig('Test.pdf') as well.
%matplotlib inline is just letting you see off the edge of the figure, whereas %matplotlib notebook is giving you a more what-you-see-is-what-you-get view. If you want yout legend over there, you can make the axis smaller (fig.subplots_adjust=0.85).
An automatic soultion could be offered by fig.tight_layout(), but tight_layout() doesn't take into account legends (yet. see #9130).
Activity
jklymak commented on Sep 7, 2017
The legend is cut off if you do fig.savefig('Test.pdf') as well.
%matplotlib inline is just letting you see off the edge of the figure, whereas %matplotlib notebook is giving you a more what-you-see-is-what-you-get view. If you want yout legend over there, you can make the axis smaller (fig.subplots_adjust=0.85).
An automatic soultion could be offered by fig.tight_layout(), but tight_layout() doesn't take into account legends (yet. see #9130).
jklymak commented on Sep 7, 2017
OK, I made a pull request: #9164
timhoffm commented on Jul 16, 2020
Closed by #9164.