Skip to content

Commit 0f08b31

Browse files
committed
Pushing the docs for revision for branch: master, commit 7c0ebbc2269612dd79ec1d64d2da866ce567c861
1 parent ba10ba3 commit 0f08b31

File tree

874 files changed

+2924
-2910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

874 files changed

+2924
-2910
lines changed

dev/_downloads/plot_lda_qda.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,19 @@ def plot_data(lda, X, y, y_pred, fig_index):
6868
X0_tp, X0_fp = X0[tp0], X0[~tp0]
6969
X1_tp, X1_fp = X1[tp1], X1[~tp1]
7070

71+
alpha = 0.5
72+
7173
# class 0: dots
72-
plt.plot(X0_tp[:, 0], X0_tp[:, 1], 'o', color='red')
73-
plt.plot(X0_fp[:, 0], X0_fp[:, 1], '.', color='#990000') # dark red
74+
plt.plot(X0_tp[:, 0], X0_tp[:, 1], 'o', alpha=alpha,
75+
color='red')
76+
plt.plot(X0_fp[:, 0], X0_fp[:, 1], '*', alpha=alpha,
77+
color='#990000') # dark red
7478

7579
# class 1: dots
76-
plt.plot(X1_tp[:, 0], X1_tp[:, 1], 'o', color='blue')
77-
plt.plot(X1_fp[:, 0], X1_fp[:, 1], '.', color='#000099') # dark blue
80+
plt.plot(X1_tp[:, 0], X1_tp[:, 1], 'o', alpha=alpha,
81+
color='blue')
82+
plt.plot(X1_fp[:, 0], X1_fp[:, 1], '*', alpha=alpha,
83+
color='#000099') # dark blue
7884

7985
# class 0 and 1 : areas
8086
nx, ny = 200, 100
@@ -104,7 +110,8 @@ def plot_ellipse(splot, mean, cov, color):
104110
angle = 180 * angle / np.pi # convert to degrees
105111
# filled Gaussian at 2 standard deviation
106112
ell = mpl.patches.Ellipse(mean, 2 * v[0] ** 0.5, 2 * v[1] ** 0.5,
107-
180 + angle, color=color)
113+
180 + angle, facecolor=color, edgecolor='yellow',
114+
linewidth=2, zorder=2)
108115
ell.set_clip_box(splot.bbox)
109116
ell.set_alpha(0.5)
110117
splot.add_artist(ell)
-17 Bytes
-17 Bytes
-77 Bytes
-77 Bytes
92 Bytes
279 Bytes
279 Bytes
86 Bytes

0 commit comments

Comments
 (0)