From 4b290ce8ef4a7f0c8d4025f8b6f2f76d40440291 Mon Sep 17 00:00:00 2001 From: Alison Date: Sat, 4 Mar 2017 11:08:52 -0500 Subject: [PATCH 1/5] Added `edgecolor` to scatterplot --- examples/decomposition/plot_pca_iris.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/decomposition/plot_pca_iris.py b/examples/decomposition/plot_pca_iris.py index f8451915b4412..e3a0541f89978 100644 --- a/examples/decomposition/plot_pca_iris.py +++ b/examples/decomposition/plot_pca_iris.py @@ -50,7 +50,8 @@ bbox=dict(alpha=.5, edgecolor='w', facecolor='w')) # Reorder the labels to have colors matching the cluster results y = np.choose(y, [1, 2, 0]).astype(np.float) -ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.spectral) +ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.spectral, \ + edgecolor='k') ax.w_xaxis.set_ticklabels([]) ax.w_yaxis.set_ticklabels([]) From 6d95067ed55fa1f9a405147133e796330baba9e0 Mon Sep 17 00:00:00 2001 From: Alison Date: Sat, 4 Mar 2017 11:43:37 -0500 Subject: [PATCH 2/5] Added `edgecolor` to scatterplot --- examples/decomposition/plot_pca_iris.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/decomposition/plot_pca_iris.py b/examples/decomposition/plot_pca_iris.py index e3a0541f89978..23bf4ce510135 100644 --- a/examples/decomposition/plot_pca_iris.py +++ b/examples/decomposition/plot_pca_iris.py @@ -50,8 +50,8 @@ bbox=dict(alpha=.5, edgecolor='w', facecolor='w')) # Reorder the labels to have colors matching the cluster results y = np.choose(y, [1, 2, 0]).astype(np.float) -ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.spectral, \ - edgecolor='k') +ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.spectral, + edgecolor='k') ax.w_xaxis.set_ticklabels([]) ax.w_yaxis.set_ticklabels([]) From 34ec89fa176cf7490fecbc2d7d65657b1b06858a Mon Sep 17 00:00:00 2001 From: Alison Date: Sat, 4 Mar 2017 11:50:37 -0500 Subject: [PATCH 3/5] Added `edgecolor` to scatters in tree module --- examples/tree/plot_tree_regression.py | 8 +++++--- examples/tree/plot_tree_regression_multioutput.py | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/tree/plot_tree_regression.py b/examples/tree/plot_tree_regression.py index 376f33150cec4..019f083c82c13 100644 --- a/examples/tree/plot_tree_regression.py +++ b/examples/tree/plot_tree_regression.py @@ -39,9 +39,11 @@ # Plot the results plt.figure() -plt.scatter(X, y, c="darkorange", label="data") -plt.plot(X_test, y_1, color="cornflowerblue", label="max_depth=2", linewidth=2) -plt.plot(X_test, y_2, color="yellowgreen", label="max_depth=5", linewidth=2) +plt.scatter(X, y, c="darkorange", edgecolor='k', label="data") +plt.plot(X_test, y_1, color="cornflowerblue", edgecolor='k', + label="max_depth=2", linewidth=2) +plt.plot(X_test, y_2, color="yellowgreen", edgecolor='k', + label="max_depth=5", linewidth=2) plt.xlabel("data") plt.ylabel("target") plt.title("Decision Tree Regression") diff --git a/examples/tree/plot_tree_regression_multioutput.py b/examples/tree/plot_tree_regression_multioutput.py index 3b75da0b6ccd0..e915aad475799 100644 --- a/examples/tree/plot_tree_regression_multioutput.py +++ b/examples/tree/plot_tree_regression_multioutput.py @@ -43,10 +43,14 @@ # Plot the results plt.figure() s = 50 -plt.scatter(y[:, 0], y[:, 1], c="navy", s=s, label="data") -plt.scatter(y_1[:, 0], y_1[:, 1], c="cornflowerblue", s=s, label="max_depth=2") -plt.scatter(y_2[:, 0], y_2[:, 1], c="c", s=s, label="max_depth=5") -plt.scatter(y_3[:, 0], y_3[:, 1], c="orange", s=s, label="max_depth=8") +plt.scatter(y[:, 0], y[:, 1], c="navy", s=s, edgecolor='k', + label="data") +plt.scatter(y_1[:, 0], y_1[:, 1], c="cornflowerblue", s=s, edgecolor='k', + label="max_depth=2") +plt.scatter(y_2[:, 0], y_2[:, 1], c="c", s=s, edgecolor='k', + label="max_depth=5") +plt.scatter(y_3[:, 0], y_3[:, 1], c="orange", s=s, edgecolor='k', + label="max_depth=8") plt.xlim([-6, 6]) plt.ylim([-6, 6]) plt.xlabel("target 1") From c67045d2238633e51cf8cc54f53e8dfa5ce82fa5 Mon Sep 17 00:00:00 2001 From: Alison Date: Sat, 4 Mar 2017 12:50:56 -0500 Subject: [PATCH 4/5] Removed `edgecolor` from plt.plot --- examples/tree/plot_tree_regression.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/tree/plot_tree_regression.py b/examples/tree/plot_tree_regression.py index 019f083c82c13..c6775c48555e2 100644 --- a/examples/tree/plot_tree_regression.py +++ b/examples/tree/plot_tree_regression.py @@ -40,10 +40,8 @@ # Plot the results plt.figure() plt.scatter(X, y, c="darkorange", edgecolor='k', label="data") -plt.plot(X_test, y_1, color="cornflowerblue", edgecolor='k', - label="max_depth=2", linewidth=2) -plt.plot(X_test, y_2, color="yellowgreen", edgecolor='k', - label="max_depth=5", linewidth=2) +plt.plot(X_test, y_1, color="cornflowerblue", label="max_depth=2", linewidth=2) +plt.plot(X_test, y_2, color="yellowgreen", label="max_depth=5", linewidth=2) plt.xlabel("data") plt.ylabel("target") plt.title("Decision Tree Regression") From e64f8f619ced2da371b351fb1356cfab1de373f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Thu, 9 Mar 2017 18:51:32 +0100 Subject: [PATCH 5/5] Revert more controversial changes --- examples/tree/plot_tree_regression.py | 2 +- examples/tree/plot_tree_regression_multioutput.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/tree/plot_tree_regression.py b/examples/tree/plot_tree_regression.py index c6775c48555e2..376f33150cec4 100644 --- a/examples/tree/plot_tree_regression.py +++ b/examples/tree/plot_tree_regression.py @@ -39,7 +39,7 @@ # Plot the results plt.figure() -plt.scatter(X, y, c="darkorange", edgecolor='k', label="data") +plt.scatter(X, y, c="darkorange", label="data") plt.plot(X_test, y_1, color="cornflowerblue", label="max_depth=2", linewidth=2) plt.plot(X_test, y_2, color="yellowgreen", label="max_depth=5", linewidth=2) plt.xlabel("data") diff --git a/examples/tree/plot_tree_regression_multioutput.py b/examples/tree/plot_tree_regression_multioutput.py index e915aad475799..3b75da0b6ccd0 100644 --- a/examples/tree/plot_tree_regression_multioutput.py +++ b/examples/tree/plot_tree_regression_multioutput.py @@ -43,14 +43,10 @@ # Plot the results plt.figure() s = 50 -plt.scatter(y[:, 0], y[:, 1], c="navy", s=s, edgecolor='k', - label="data") -plt.scatter(y_1[:, 0], y_1[:, 1], c="cornflowerblue", s=s, edgecolor='k', - label="max_depth=2") -plt.scatter(y_2[:, 0], y_2[:, 1], c="c", s=s, edgecolor='k', - label="max_depth=5") -plt.scatter(y_3[:, 0], y_3[:, 1], c="orange", s=s, edgecolor='k', - label="max_depth=8") +plt.scatter(y[:, 0], y[:, 1], c="navy", s=s, label="data") +plt.scatter(y_1[:, 0], y_1[:, 1], c="cornflowerblue", s=s, label="max_depth=2") +plt.scatter(y_2[:, 0], y_2[:, 1], c="c", s=s, label="max_depth=5") +plt.scatter(y_3[:, 0], y_3[:, 1], c="orange", s=s, label="max_depth=8") plt.xlim([-6, 6]) plt.ylim([-6, 6]) plt.xlabel("target 1")