Skip to content

Make the frame size of animation writers be the canvas size rather than the figure size - #32194

Draft
ayshih wants to merge 1 commit into
matplotlib:mainfrom
ayshih:animation_canvas_size
Draft

Make the frame size of animation writers be the canvas size rather than the figure size#32194
ayshih wants to merge 1 commit into
matplotlib:mainfrom
ayshih:animation_canvas_size

Conversation

@ayshih

@ayshih ayshih commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

PR summary

As reported in #32186, the change in #32038 to have appropriately rounded canvas sizes made the necessary updates to the backends, but missed that matplotlib.animation also needed to be updated. This PR updates matplotlib.animation to use the canvas size rather than the figure size for the frame size.

Closes #32186

AI Disclosure

No AI was used

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New features and API changes have release notes
  • [N/A] Documentation complies with general and docstring guidelines

ho /= self.dpi
if self.codec == 'h264':
wo, ho = self.fig.get_size_inches()
w, h = adjusted_figsize(wo, ho, self.dpi, 2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the calculation in adjusted_figsize?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GIF frames become skewed when using PillowWriter in matplotlib 3.11.1

2 participants