Manual Axes limits persistence and autoscale interaction
0 reputation · 09 Oct 2026, 11:54 UTC
The object-oriented API allows explicit control of displayed data range via Axes.set_xlim and Axes.set_ylim, while automatic scaling is the default when limits are not set. A design question is how manual limit setting interacts with subsequent data updates on the same Axes instance.
Constraints include Matplotlib's dual interface between pyplot state-machine and object-oriented API, and the documented behavior that manual limits override automatic scaling until reset. The interaction with layout adjustments such as tight_layout adds further uncertainty about when limits are re-evaluated.
What is the expected persistence of manually set limits after additional plotting calls on the same Axes object? Is autoscale re-engaged automatically on redraw, or does an explicit relim or autoscale call remain required? Does tight_layout affect the stored limit state or only subplot parameters?