-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update MovieWriter dpi default #8063
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
Update MovieWriter dpi default #8063
Conversation
lib/matplotlib/animation.py
Outdated
@@ -165,7 +165,7 @@ def setup(self, fig, outfile, dpi): | |||
The filename of the resulting movie file | |||
dpi: int | |||
The DPI (or resolution) for the file. This controls the size | |||
in pixels of the resulting movie file. | |||
in pixels of the resulting movie file. Default is figure.dpi. |
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.
The docstring on this needs , optional
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.
probably on all of the docstrings actually.
@tacaswell I just updated the docstrings. I just noticed that in Animate.save() has dpi=None default to rcParam['savefig.dpi'], and only if this is 'figure' it is set to figure.dpi. Should I use that behavior instead of setting None to figure.dpi? |
On one hand what you have here is simpler and does not depend on global state, on the other hand reaching out to I am leaning towards not defaulting to |
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.
I'm 👍 on the change--just the question about the docs.
lib/matplotlib/animation.py
Outdated
The DPI (or resolution) for the file. This controls the size | ||
in pixels of the resulting movie file. | ||
in pixels of the resulting movie file. Default is figure.dpi. |
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.
Here too?
lib/matplotlib/animation.py
Outdated
The DPI (or resolution) for the file. This controls the size | ||
in pixels of the resulting movie file. | ||
in pixels of the resulting movie file. Default is figure.dpi. |
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 figure.dpi be fig.dpi
since fig is the name of the argument?
lib/matplotlib/animation.py
Outdated
The dpi of the output file. This, with the figure size, | ||
controls the size in pixels of the resulting movie file. | ||
Default is figure.dpi. |
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.
And here?
@tacaswell @dopplershift Thanks, I updated in (c2aac89). Let me know if should rebase this on master/squash some of these commits to something cleaner. |
If it's not a lot of effort, I'd prefer to see this squashed down a bit. |
c2aac89
to
47ef9df
Compare
47ef9df
to
e0c002c
Compare
@dopplershift I squashed all the lints/nits into the original commit so it looks like it never happened. I also rebased on the current master because I was a few commits behind. |
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.
Pending one last run of CI.
Thanks @heath730 ! |
Adds default
dpi=None
argument to *MovieWriter classes, and usesfigure.dpi
as the default if dpi is None.This is related to issue #7616. @tacaswell please advise if this approach is what you had in mind for resolving the issue.
I'm a new contributor and I wasn't exactly sure the best way to unit test a change like this. However, I created a test that calls setup with dpi as the default, and makes sure that dpi is set to the
figure.dpi
. I did not add a change log entry because it is such a small change, please let me know if I should.