Skip to content

FIX: fix wrongly used plt.show() in examples #31524

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

Merged

Conversation

ChVeen
Copy link
Contributor

@ChVeen ChVeen commented Jun 11, 2025

Reference Issues/PRs

No issue involved.

What does this implement/fix? Explain your changes.

Function matplotlib.pyplot.show() doesn't return a value (see: https://github.com/matplotlib/matplotlib/blob/v3.10.3/lib/matplotlib/pyplot.py#L569-L614), but at several examples it is used like _ = plt.show().
This PR fixes this for all found occurrences:

$ git grep -E "= plt.show()"
examples/bicluster/plot_spectral_biclustering.py:_ = plt.show()
examples/bicluster/plot_spectral_biclustering.py:_ = plt.show()
examples/bicluster/plot_spectral_biclustering.py:_ = plt.show()
examples/svm/plot_svm_kernels.py:_ = plt.show()

Any other comments?

Copy link

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 8a5ce9c. Link to the linter CI: here

Copy link
Contributor

@StefanieSenger StefanieSenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, that's very true. Thanks for the PR, @ChVeen!

@StefanieSenger StefanieSenger added the Quick Review For PRs that are quick to review label Jun 11, 2025
Copy link
Member

@lucyleeow lucyleeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lucyleeow lucyleeow merged commit 780b393 into scikit-learn:main Jun 12, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants