-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added bbox_inches flag. Defaults to None #95
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bbox_inches
and pad_inches
can be modified via rcParams, so another way to resolve this could be to document how to do that.
@@ -274,6 +276,9 @@ def __init__( | |||
Movie size. | |||
dpi : int | |||
Movie resolution. | |||
bbox_inches: str | |||
Same as bbox_inches flag in savefig from matplotlib. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as bbox_inches flag in savefig from matplotlib. | |
Passed to :meth:`~matplotlib.figure.Figure.savefig` when saving frames. |
@@ -274,6 +276,9 @@ def __init__( | |||
Movie size. | |||
dpi : int | |||
Movie resolution. | |||
bbox_inches: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bbox_inches: str | |
bbox_inches: str or matplotlib.transforms.Bbox |
@@ -274,6 +276,9 @@ def __init__( | |||
Movie size. | |||
dpi : int | |||
Movie resolution. | |||
bbox_inches: str | |||
Same as bbox_inches flag in savefig from matplotlib. | |||
Bounding box in inches: only the given portion of the figure is saved. If 'tight', try to figure out the tight bbox of the figure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bounding box in inches: only the given portion of the figure is saved. If 'tight', try to figure out the tight bbox of the figure. | |
Bounding box in inches: only the given portion of the figure is saved. | |
If ``'tight'``, try to figure out the tight bbox of the figure. | |
Try this option to eliminate unnecessary amounts of edge whitespace in frames. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should pad_inches
also be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh so sorry I didnt even realize that this PR was already submitted.
In general I am ok with it, but I wonder if we can generalize the input, so that the user can change any kwarg on .savefig()
without us having to copy everyone of them?
@@ -253,6 +254,7 @@ def __init__( | |||
pixelwidth=1920, | |||
pixelheight=1080, | |||
dpi=200, | |||
bbox_inches=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might add other kwargs for .savefig()
here (see comments below). If so should we have some dict that catches all save_kwargs=None
(we can then set defaults we like in the init)? Otherwise we might be accumulating a bunch of input arguments and the signature of this might become unruly?
@@ -285,6 +290,7 @@ def __init__( | |||
self.pixelwidth = pixelwidth | |||
self.pixelheight = pixelheight | |||
self.dpi = dpi | |||
self.bbox_inches = bbox_inches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I would prefer to carry self.save_kwargs
here as a dict.
Codecov Report
@@ Coverage Diff @@
## master #95 +/- ##
==========================================
+ Coverage 77.53% 78.59% +1.05%
==========================================
Files 3 3
Lines 325 327 +2
Branches 61 61
==========================================
+ Hits 252 257 +5
+ Misses 48 46 -2
+ Partials 25 24 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Related to #94
This may help users with eliminating whitespace and other alignment related issues.