matplotlib / matplotlib/matplotlib

Deprecate bbox and xy parameters to restore_region?

Open
#19,095 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

API: changes backend: agg keep Maintenance topic: animation
Dominant language
Python
Stars
23.2k
Forks
8.5k
Avg merge
1d 6h
Merged PRs (30d)
66

Description

### Describe the issue

**Summary**

`RendererAgg.restore_region` takes two optional kwargs, `bbox` and `xy`, which specify respectively a subregion and and offset for the restoring. These were introduced in b1c784d for manual animations where subregions of specific patterns would be blitted with certain offsets. This was demonstrated in a single example, which was removed in e547d6f, and never used anywhere else.

I would suggest deprecating and then getting rid of the feature: there doesn't seem to be much demand for it (no other use anywhere in the library or the examples); the kind of animation it allows is extremely specific, and likely it should be possible to build something similarly efficient using `FigureImage` (i.e., drawing a non-resampled array at a given position should really just involve setting the correspoding pixels in the bitmap) anyways.

Also, that means one less thing to implement in mplcairo for feature parity :)

Is there anyone opposed to such a removal?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the RendererAgg.restore_region entry point and verify the reported uses of its bbox and xy parameters across the library and examples. Review the deprecation and removal expectations for this API; done means the obsolete feature has an agreed, complete removal path without breaking remaining uses or mplcairo parity.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.