From 5fb8dc8e2681d8b00c3cb8ce4ddd685c59102aa7 Mon Sep 17 00:00:00 2001 From: Janis Klaise Date: Mon, 18 Sep 2023 11:55:04 +0100 Subject: [PATCH] Fix plot_pd function to work with matplotlib 3.8.0 changes --- alibi/explainers/partial_dependence.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alibi/explainers/partial_dependence.py b/alibi/explainers/partial_dependence.py index 5cffffeb6..51053aeee 100644 --- a/alibi/explainers/partial_dependence.py +++ b/alibi/explainers/partial_dependence.py @@ -1096,8 +1096,10 @@ def _is_categorical(feature): for ax_group in one_way_axs.values(): min_val = min([ax_pd_lim[0] for _, ax_pd_lim in ax_group]) max_val = max([ax_pd_lim[1] for _, ax_pd_lim in ax_group]) - ax_group[0][0].get_shared_y_axes().join(ax_group[0][0], *[ax[0] for ax in ax_group[1:]]) - ax_group[0][0].set_ylim(min_val, max_val) + axs = [ax[0] for ax in ax_group] + for ax1, ax2 in zip(axs, axs[1:]): + ax1.sharey(ax2) + axs[0].set_ylim(min_val, max_val) fig.set(**fig_kw) return axes