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
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).
Bug report
When using matplotlib in a Jupyter Notebook with the magic
%matplotlib notebook
, legends placed outside of the axis are cut off.Code for reproduction
Actual outcome
Expected outcome
The legend would be fully displayed as in the following example. This plot obtained by switching to

%matplotlib inline
Matplotlib version
Matplotlib and python were installed using Anaconda
Additional Information
This seems similar to #2530
The text was updated successfully, but these errors were encountered: