MatplotlibDeprecationWarning default visibility in long-running scripts
0 reputation · 12 Dec 2020, 23:47 UTC
Goal
Keep Matplotlib deprecation warnings visible long enough to act on them, without turning long-running scripts or notebooks into continuous notification noise. The scope is Matplotlib's own warnings, not third-party libraries.
Constraints
Warning filters are global to Python's warnings module, so a broad filter can suppress important alerts from other packages. Matplotlib emits MatplotlibDeprecationWarning by default and does not filter it internally. The figure.max_open_warning rcParam adds a separate UserWarning threshold for open figures. Behavior and rcParam names can change between releases, so assume Matplotlib 3.x and recheck the target version.
Open decision
It is unresolved whether MatplotlibDeprecationWarning should be opt-in or opt-out by default. Current behavior shows every deprecation warning, which supports migration but creates noise for users who cannot update immediately.
Can Matplotlib surface each deprecation warning once per process without global filter side effects? Should MatplotlibDeprecationWarning be opt-out by default in the next minor release? How should figure.max_open_warning interact with user-defined warning filters in interactive sessions?