Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix render backend issues for animating graphs#720

Merged
cvanelteren merged 2 commits into
mainUltraplot/UltraPlot:mainfrom
fix/issue-718-animation-tight-layoutUltraplot/UltraPlot:fix/issue-718-animation-tight-layoutCopy head branch name to clipboard
May 12, 2026
Merged

Fix render backend issues for animating graphs#720
cvanelteren merged 2 commits into
mainUltraplot/UltraPlot:mainfrom
fix/issue-718-animation-tight-layoutUltraplot/UltraPlot:fix/issue-718-animation-tight-layoutCopy head branch name to clipboard

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

Closes #718

This fixes the layout shifting reported when saving animations by making UltraPlot run a full tight-layout pass only on the first saved frame, then reuse the established geometry on later dirty frames instead of repeatedly re-running tight=True during FuncAnimation.save(). The root issue was that frame updates like axs.format(...) were marking the figure layout dirty, and the save-time canvas preprocessing was then tightening the layout again for each subsequent frame, which could cause visible position changes early in the animation, especially with writer="ffmpeg". The change lives in ultraplot/figure.py, where save-time layout processing now falls back to fig.auto_layout(tight=False) after the first saved frame, and it is covered by a regression test in ultraplot/tests/test_animation.py that saves a small animation and verifies that only the first save-time layout pass uses tight layout.

…ng the established geometry on later dirty frames instead of re-running tight layout each time. Add a regression test that saves a small animation and verifies only the first save-time layout pass uses tight layout.
@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cvanelteren cvanelteren merged commit d9b3af6 into main May 12, 2026
18 checks passed
@cvanelteren cvanelteren deleted the fix/issue-718-animation-tight-layout branch May 12, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Differences in Animation Creation Between FFmpeg and Pillow Writer

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.