Skip to content

Improve plot update performance by reusing Matplotlib artists#2

Open
PumpGame wants to merge 9 commits into
mainfrom
codex/improve-program-speed-and-responsiveness
Open

Improve plot update performance by reusing Matplotlib artists#2
PumpGame wants to merge 9 commits into
mainfrom
codex/improve-program-speed-and-responsiveness

Conversation

@PumpGame
Copy link
Copy Markdown
Owner

@PumpGame PumpGame commented Jan 1, 2026

Motivation

  • The interactive plot was triggering full redraws on many operations which made the UI sluggish and unresponsive.
  • The goal is to speed up pan/zoom/drag/selection interactions by avoiding unnecessary recreation of plot objects.

Description

  • Added cached artist attributes basemap_artist, track_line, and scatter and reset them on full redraws to enable reuse.
  • Updated _update_plot to update existing artists (set data/offsets/extent) instead of calling plot/scatter/imshow every time, and to remove the basemap artist when map is disabled.
  • Recreate the info box only when necessary by checking full or whether self.info_text is present in self.ax.texts to avoid extra text objects.
  • Kept existing selection, undo/redo and KD-tree logic unchanged while ensuring artists stay in sync with data updates.

Testing

  • No automated tests were executed.

Codex Task

@PumpGame PumpGame force-pushed the main branch 2 times, most recently from bbcfc03 to 4bb3d7b Compare May 12, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant