Update MovieWriter dpi default#8063
Conversation
lib/matplotlib/animation.py
Outdated
| 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.
The docstring on this needs , optional added
There was a problem hiding this comment.
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 |
dopplershift
left a comment
There was a problem hiding this comment.
I'm 👍 on the change--just the question about the docs.
lib/matplotlib/animation.py
Outdated
| dpi : int, optional | ||
| 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. |
lib/matplotlib/animation.py
Outdated
| dpi: int, optional | ||
| 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.
Should figure.dpi be fig.dpi since fig is the name of the argument?
lib/matplotlib/animation.py
Outdated
| dpi : number, optional | ||
| 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. |
|
@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. |
dopplershift
left a comment
There was a problem hiding this comment.
Pending one last run of CI.
|
Thanks @heath730 ! |
Adds default
dpi=Noneargument to *MovieWriter classes, and usesfigure.dpias 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.