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
With the current ipympl 0.9.6 (and probably earlier versions) I am observing excessive white space around axes in some cases when using the %matplotlib ipympl mode but not in the %matplotlib inline mode.
Especially larger figures then became unmanageable in the ipympl backend. Setting constrained_layout or using plt.tight_layout() does not seem to influence the margins. Can this behavior be influenced?
The text was updated successfully, but these errors were encountered:
inline ultimately sets bbox_inches='tight'and changes the figure shape which is why there is less whitespace. The tight or constrained layouts move axes around inside of the figure without changing the figize. With the aspect ratio you are using that is the least possible amount of whitespace without making the figure smaller.
This is not unique to ipympl. You can see the same behavior with the qt backend:
The solution here is to change your figsize to better match the aspect ratio of your plot
plt.tight_layout() does not seem to influence the margins. Can this behavior be influenced?
Unfortunately I don't think there is a way to automatically change the figsize to better match the axes. What bbox_inches='tight' in savefig does is effectively to crop the figure before display, but that only makes sense when using a static display as in inline.
With the current ipympl 0.9.6 (and probably earlier versions) I am observing excessive white space around axes in some cases when using the
%matplotlib ipympl
mode but not in the%matplotlib inline
mode.A small example to reproduce:
This yields:
And the same example in inline mode:
Especially larger figures then became unmanageable in the
ipympl
backend. Settingconstrained_layout
or usingplt.tight_layout()
does not seem to influence the margins. Can this behavior be influenced?The text was updated successfully, but these errors were encountered: