-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix shap.summary_plot to work with matplotlib 3.6.0 #2697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix shap.summary_plot to work with matplotlib 3.6.0 #2697
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2697 +/- ##
=======================================
Coverage 55.35% 55.35%
=======================================
Files 90 90
Lines 12873 12873
=======================================
Hits 7126 7126
Misses 5747 5747
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thank you for the PR! May I suggest also adding the same fix to a few other places in
I think the other uses of colorbar are ok, as they already provide the |
PS - it would be great to validate the fix with the unit tests on CI with the problematic version. I'd suggest pushing a commit to temporarily pin matplotlib in pyproject.toml line 39: [project.optional-dependencies]
plots = ["matplotlib==3.6.0", "ipython"] (Nb we can ignore the test on python 3.7, which isn't compatible with matplotlib 3.6.0). Once the other tests pass, we can then remove the version pin. |
FYI That being said, it's still worth adding explicit axes for people running Btw with the explicit axes we still get a warning |
I think that the |
@connortann The same should apply for |
That's rather concerning, that we have no tests for If you'd kindly remove the temporary version pin, I think this PR is good to go! |
Downgrading to |
Fixes #2687. Have tested this manually by calling
shap.summary_plot(...)
to produce expected behaviour.Note that there may be additional places where this is needed, e.g. for other plots, here's a grep of all the occurences of
pl.colorbar
in the codebase: