Closed
Description
In #29388 we pinned matplotlib<3.9
see in particular #29388 (comment).
This is a DeprecationWarning in matplotlib 3.9 turned into error in the CI:
matplotlib._api.deprecation.MatplotlibDeprecationWarning: The 'labels' parameter of boxplot() has been renamed 'tick_labels' since Matplotlib 3.9; support for the old name will be dropped in 3.11.
3 examples fail (DeprecationWarning turned into error): they have been fixed in #29471.
-
examples/inspection/plot_permutation_importance_multicollinear.py
-
examples/ensemble/plot_gradient_boosting_regression.py
-
examples/release_highlights/plot_release_highlights_0_22_0.py
See build log from one of the commit in this #29388.
The easiest work-around is likely to do some version comparison something like this (not tested):
from sklearn.utils.fixes import parse_version
import matplotlib
tick_labels = ...
# labels has been renamed to tick_labels in matplotlib 3.9. This code can be simplified when scikit-learn minimum supported version is 3.9
tick_labels_parameter_name = "tick_labels" if parse_version(matplotlib.__version__) >= parse_version("3.9") else "labels"
tick_labels_dict = {tick_labels_parameter_name: tick_labels}
plt.boxplot(..., **tick_labels_dict)