Open
Description
Problem
This is triggered by #25127 most recently, but this is a discussion we have had a couple of times.
The core of the problem is that users have different expectations about what things will automatically adjust the axes limits (or not) in autolim mode. Currently Lines
, Patches
and AxesImage
obligatorily participate
matplotlib/lib/matplotlib/axes/_base.py
Lines 2459 to 2483 in a046ee3
matplotlib/lib/matplotlib/axes/_base.py
Lines 2260 to 2273 in a046ee3
Proposed solution
The proposed solution is to:
- move the
_update_line_limits
and friends to the respective Artists - add an analogous method to the base
Artist
(probably defaulting to failure) - add a "I would like to particpate in autolimiting!" flag to base
Artist
- in
relim
look at the flag and call the newly generalized method above on any artists that opt-in
This will involved a little bit of public API (how to set the state to opt-in) and a bunch of private API (what should the signature of the method be).