-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
MNT Use name instead of float to specify colors #12199
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fix looks good to me:
c=
is meant to pass numerical values to be mapped to a color according to a color map;color=
on the other hand is mean to pass a uniform color specifier.
@@ -54,11 +54,11 @@ | |||
clf.fit(this_X, y_train) | |||
|
|||
ax.plot(X_test, clf.predict(X_test), color='.5') | |||
ax.scatter(this_X, y_train, s=3, c='.5', marker='o', zorder=10) | |||
ax.scatter(this_X, y_train, s=3, color='.5', marker='o', zorder=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think color='gray'
would be more explicit.
|
||
clf.fit(X_train, y_train) | ||
ax.plot(X_test, clf.predict(X_test), linewidth=2, color='blue') | ||
ax.scatter(X_train, y_train, s=30, c='r', marker='+', zorder=10) | ||
ax.scatter(X_train, y_train, s=30, color='r', marker='+', zorder=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think color='red'
would be more explicit.
Let's merge. I still think that using |
Thanks. I've opened #12224 to further improve the plot (including the title & axis) and this can serve as part of that issue, but AFAIK |
FIxes #12191
I guess this is reasonable, but would definitely welcome better solution from someone more familiar with matplotlib colors