You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Legends cut off in Jupyter Notebooks when plotting with %matplotlib notebook command #9163
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 commentedon Sep 7, 2017
The legend is cut off if you do
fig.savefig('Test.pdf')as well.%matplotlib inlineis just letting you see off the edge of the figure, whereas%matplotlib notebookis 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(), buttight_layout()doesn't take into account legends (yet. see #9130).jklymak commentedon Sep 7, 2017
OK, I made a pull request: #9164
timhoffm commentedon Jul 16, 2020
Closed by #9164.