8000 [MRG+1] Modify General examples for matplotlib v2 comp (#8413) · scikit-learn/scikit-learn@93bbe54 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93bbe54

Browse files
rishikksh20amueller
authored andcommitted
[MRG+1] Modify General examples for matplotlib v2 comp (#8413)
* Modify plot_cv_predict.py for matplotlib v2 comp Add `edgecolors` in scatter plot for matplotlib v2. Issue: #8364 * Modify plot_multilabel.py for matplotlib v2 Add `edgecolors` in scatterr plot for matplotlib v2. Issue: #8364 * Modify plot_kernel_ridge_regression for matplotlib v2 Add `edgecolors` in scatter plot and `makeredgecolor` in plot. Issue: #8364 * Modify plot_kernel_approximation.py for matplotlib v2 Add `edgecolors` in scatter plot for matplotlib v2. Issue: #8364 * Change plot_kernel_ridge_regression for better plot Remove `markeredgecolor` for better plot. Issue:#8364
1 parent 2c20b0b commit 93bbe54

4 files changed

+9
-7
lines changed

examples/plot_cv_predict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
predicted = cross_val_predict(lr, boston.data, y, cv=10)
2222

2323
fig, ax = plt.subplots()
24-
ax.scatter(y, predicted)
24+
ax.scatter(y, predicted, edgecolors=(0, 0, 0))
2525
ax.plot([y.min(), y.max()], [y.min(), y.max()], 'k--', lw=4)
2626
ax.set_xlabel('Measured')
2727
ax.set_ylabel('Predicted')

examples/plot_kernel_approximation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@
205205
plt.axis('off')
206206

207207
# Plot also the training points
208-
plt.scatter(X[:, 0], X[:, 1], c=targets_train, cmap=plt.cm.Paired)
208+
plt.scatter(X[:, 0], X[:, 1], c=targets_train, cmap=plt.cm.Paired,
209+
edgecolors=(0, 0, 0))
209210

210211
plt.title(titles[i])
211212
plt.tight_layout()

examples/plot_kernel_ridge_regression.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@
101101
# look at the results
102102
sv_ind = svr.best_estimator_.support_
103103
plt.scatter(X[sv_ind], y[sv_ind], c='r', s=50, label='SVR support vectors',
104-
zorder=2)
105-
plt.scatter(X[:100], y[:100], c='k', label='data', zorder=1)
104+
zorder=2, edgecolors=(0, 0, 0))
105+
plt.scatter(X[:100], y[:100], c='k', label='data', zorder=1,
106+
edgecolors=(0, 0, 0))
106107
plt.hold('on')
107108
plt.plot(X_plot, y_svr, c='r',
108109
label='SVR (fit: %.3fs, predict: %.3fs)' % (svr_fit, svr_predict))

examples/plot_multilabel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ def plot_subfigure(X, Y, subplot, title, transform):
7373

7474
zero_class = np.where(Y[:, 0])
7575
one_class = np.where(Y[:, 1])
76-
plt.scatter(X[:, 0], X[:, 1], s=40, c='gray')
76+
plt.scatter(X[:, 0], X[:, 1], s=40, c='gray', edgecolors=(0, 0, 0))
7777
plt.scatter(X[zero_class, 0], X[zero_class, 1], s=160, edgecolors='b',
78-
facecolors='none', linewidths=2, label='Class 1')
78+
facecolors='none', linewidths=2, label='Class 1')
7979
plt.scatter(X[one_class, 0], X[one_class, 1], s=80, edgecolors='orange',
80-
facecolors='none', linewidths=2, label='Class 2')
80+
facecolors='none', linewidths=2, label='Class 2')
8181

8282
plot_hyperplane(classif.estimators_[0], min_x, max_x, 'k--',
8383
'Boundary\nfor class 1')

0 commit comments

Comments
 (0)
0