Repository navigation
DOC fix colors and typos in example on Multinomial and One-vs-Rest Decision Boundaries - #33622
Merged
adrinjalali merged 3 commits intoMar 27, 2026
Conversation
AnneBeyer
commented
Mar 24, 2026
| from sklearn.datasets import make_blobs | ||
|
|
||
| # get the first three colors from the "tab10" colormap for easily distinguishable colors | ||
| cmap = mpl.colors.ListedColormap((plt.get_cmap("tab10").colors[:3])) |
Member
Author
There was a problem hiding this comment.
This explicit selection is necessary because if we simply specify "tab10", 3 evenly spaced colors will be selected from the colormap by .scatter, leading to inconsistencies with the decision boundary again.
AnneBeyer
marked this pull request as ready for review
March 27, 2026 12:55
adrinjalali
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Towards #33557
What does this implement/fix? Explain your changes.
Fixes the color inconsistency between scatter plot and decision boundary/hyperplanes in the example on Decision Boundaries of Multinomial and One-vs-Rest Logistic Regression (
plot_logistic_multinomial.py)to use the first three colors of the"tab10"colormap consistently throughout the example. (This was set as the default for theDecisionBoundaryDisplayfor multiclass with < 10 classes.)EDIT: After consulting with @adrinjalali, I changed it to use the
coolwarmcolormap, as orange and green can be hard to distinguishable in the scatterplot and hyperplanes (see also https://www.color-blindness.com/coblis-color-blindness-simulator/).From




to
and
and
AI usage disclosure
I used AI assistance for:
Any other comments?
Also fixes some typos/wording on the side.