Skip to content

Commit

Permalink
Fix plot_pd function to work with matplotlib 3.8.0 changes (#965)
Browse files Browse the repository at this point in the history
* Fix plot_pd function to work with matplotlib 3.8.0 changes

* Simplify sharing axes
  • Loading branch information
jklaise authored Sep 27, 2023
1 parent 54d0c95 commit 7f1d48e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions alibi/explainers/partial_dependence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ax in axs[1:]:
ax.sharey(axs[0])
axs[0].set_ylim(min_val, max_val)

fig.set(**fig_kw)
return axes
Expand Down

0 comments on commit 7f1d48e

Please sign in to comment.