10BC0 Close figures before plotting by deruyter92 · Pull Request #3168 · DeepLabCut/DeepLabCut · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@deruyter92
Copy link
Collaborator
@deruyter92 deruyter92 commented Jan 6, 2026

Closing all plots before plotting new ones. This avoids overflowing the screen with old plots.

This commit changes behavior from only closing figures when showfigures=False to always closing figures before plotting. Addresses feature request #3164.

…d plots.

This commit changes behavior from only closing figures when `showfigures=False` to always closing figures before plotting. Addressing feature request DeepLabCut#3164.
Copy link
Contributor
Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the PlottingResults function to close all matplotlib figures before creating new plots, addressing feature request #3164. Previously, figures were only closed when showfigures=False; now they are always closed at the start of the function to prevent figure accumulation.

Key Changes:

  • Always close figures before plotting (regardless of showfigures parameter)
  • Simplified end-of-function logic to only show figures when requested

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deruyter92
Copy link
Collaborator Author

@MMathisLab, this PR is a matter of design choice / preferred behavior for the plot_trajectories function.

  • Current behavior: all figures stay open, you have to manually close previous plots if you don't want to see them.
  • Merging this PR -> all figures close before plotting. Only the fresh plots will be visible when plotting trajectories.

Both are valid options.

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.

2 participants

0