Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4a742e

Browse files
authored
Merge branch 'dylewsky:master' into master
2 parents a247fb8 + ca8091d commit a4a742e

28 files changed

+116
-116
lines changed

CH01/CH01_SEC04_1_Linear.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
"a = a.reshape(-1, 1)\n",
3030
"b = x*a + np.random.randn(*a.shape) # Add noise\n",
3131
"\n",
32-
"plt.plot(a, x*a, Color='k', LineWidth=2, label='True line') # True relationship\n",
33-
"plt.plot(a, b, 'x', Color='r', MarkerSize = 10, label='Noisy data') # Noisy measurements\n",
32+
"plt.plot(a, x*a, color='k', linewidth=2, label='True line') # True relationship\n",
33+
"plt.plot(a, b, 'x', color='r', MarkerSize = 10, label='Noisy data') # Noisy measurements\n",
3434
"\n",
3535
"U, S, VT = np.linalg.svd(a,full_matrices=False)\n",
3636
"xtilde = VT.T @ np.linalg.inv(np.diag(S)) @ U.T @ b # Least-square fit\n",
3737
"\n",
38-
"plt.plot(a,xtilde * a,'--',Color='b',LineWidth=4, label='Regression line')\n",
38+
"plt.plot(a,xtilde * a,'--',color='b',linewidth=4, label='Regression line')\n",
3939
"\n",
4040
"plt.xlabel('a')\n",
4141
"plt.ylabel('b')\n",

CH01/CH01_SEC04_2_Cement.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"U, S, VT = np.linalg.svd(A,full_matrices=0)\n",
3434
"x = VT.T @ np.linalg.inv(np.diag(S)) @ U.T @ b\n",
3535
"\n",
36-
"plt.plot(b, Color='k', LineWidth=2, label='Heat Data') # True relationship\n",
37-
"plt.plot(A@x, '-o', Color='r', LineWidth=1.5, MarkerSize=6, label='Regression')\n",
36+
"plt.plot(b, color='k', linewidth=2, label='Heat Data') # True relationship\n",
37+
"plt.plot(A@x, '-o', color='r', linewidth=1.5, markersize=6, label='Regression')\n",
3838
"plt.legend()\n",
3939
"plt.show()"
4040
]

CH01/CH01_SEC04_3_Housing.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@
4242
"fig = plt.figure()\n",
4343
"ax1 = fig.add_subplot(121)\n",
4444
"\n",
45-
"plt.plot(b, Color='k', LineWidth=2, label='Housing Value') # True relationship\n",
46-
"plt.plot(A@x, '-o', Color='r', LineWidth=1.5, MarkerSize=6, label='Regression')\n",
45+
"plt.plot(b, color='k', linewidth=2, label='Housing Value') # True relationship\n",
46+
"plt.plot(A@x, '-o', color='r', linewidth=1.5, markersize=6, label='Regression')\n",
4747
"plt.xlabel('Neighborhood')\n",
4848
"plt.ylabel('Median Home Value [$1k]')\n",
4949
"plt.legend()\n",
5050
"\n",
5151
"ax2 = fig.add_subplot(122)\n",
5252
"sort_ind = np.argsort(H[:,-1])\n",
53-
"plt.plot(b[sort_ind], Color='k', LineWidth=2, label='Housing Value') # True relationship\n",
54-
"plt.plot(A[sort_ind,:]@x, '-o', Color='r', LineWidth=1.5, MarkerSize=6, label='Regression')\n",
53+
"plt.plot(b[sort_ind], color='k', linewidth=2, label='Housing Value') # True relationship\n",
54+
"plt.plot(A[sort_ind,:]@x, '-o', color='r', linewidth=1.5, markersize=6, label='Regression')\n",
5555
"plt.xlabel('Neighborhood')\n",
5656
"plt.legend()\n",
5757
"\n",
@@ -122,7 +122,7 @@
122122
"name": "python",
123123
"nbconvert_exporter": "python",
124124
"pygments_lexer": "ipython3",
125-
"version": "3.7.5"
125+
"version": "3.8.5"
126126
}
127127
},
128128
"nbformat": 4,

CH01/CH01_SEC05_1_PCAGaussian.ipynb

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

CH01/CH01_SEC05_2_OvarianCancer.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"name": "python",
9797
"nbconvert_exporter": "python",
9898
"pygments_lexer": "ipython3",
99-
"version": "3.7.3"
99+
"version": "3.8.5"
100100
}
101101
},
102102
"nbformat": 4,

CH01/CH01_SEC06_2_3_4.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@
214214
"PCACoordsP1 = U[:,PCAmodes-np.ones_like(PCAmodes)].T @ P1\n",
215215
"PCACoordsP2 = U[:,PCAmodes-np.ones_like(PCAmodes)].T @ P2\n",
216216
"\n",
217-
"plt.plot(PCACoordsP1[0,:],PCACoordsP1[1,:],'d',Color='k',label='Person 2')\n",
218-
"plt.plot(PCACoordsP2[0,:],PCACoordsP2[1,:],'^',Color='r',label='Person 7')\n",
217+
"plt.plot(PCACoordsP1[0,:],PCACoordsP1[1,:],'d',color='k',label='Person 2')\n",
218+
"plt.plot(PCACoordsP2[0,:],PCACoordsP2[1,:],'^',color='r',label='Person 7')\n",
219219
"\n",
220220
"plt.legend()\n",
221221
"plt.show()"

CH01/CH01_SEC07_1.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@
173173
"\n",
174174
"fig1,ax1 = plt.subplots(1)\n",
175175
"\n",
176-
"ax1.semilogy(S,'-o', color='k', LineWidth=2)\n",
177-
"ax1.semilogy(np.diag(S[:(r+1)]),'o', color='r', LineWidth=2)\n",
178-
"ax1.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', LineWidth=2)\n",
179-
"rect = patches.Rectangle((-5,20),100,200,LineWidth=2,LineStyle='--',FaceColor='none',EdgeColor='k')\n",
176+
"ax1.semilogy(S,'-o', color='k', linewidth=2)\n",
177+
"ax1.semilogy(np.diag(S[:(r+1)]),'o', color='r', linewidth=2)\n",
178+
"ax1.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', linewidth=2)\n",
179+
"rect = patches.Rectangle((-5,20),100,200,linewidth=2,linestyle='--',facecolor='none',edgecolor='k')\n",
180180
"ax1.add_patch(rect)\n",
181181
"plt.xlim((-10,610))\n",
182182
"plt.ylim((0.003,300))\n",
@@ -185,22 +185,22 @@
185185
"\n",
186186
"fig2,ax2 = plt.subplots(1)\n",
187187
"\n",
188-
"ax2.semilogy(S,'-o', color='k', LineWidth=2)\n",
189-
"ax2.semilogy(np.diag(S[:(r+1)]),'o', color='r', LineWidth=2)\n",
190-
"ax2.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', LineWidth=2)\n",
188+
"ax2.semilogy(S,'-o', color='k', linewidth=2)\n",
189+
"ax2.semilogy(np.diag(S[:(r+1)]),'o', color='r', linewidth=2)\n",
190+
"ax2.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', linewidth=2)\n",
191191
"plt.xlim((-5,100))\n",
192192
"plt.ylim((20,200))\n",
193193
"ax2.grid()\n",
194194
"plt.show()\n",
195195
"\n",
196196
"fig3,ax3 = plt.subplots(1)\n",
197-
"ax3.plot(cdS,'-o',color='k',LineWidth=2)\n",
198-
"ax3.plot(cdS[:(r90+1)],'o',color='b',LineWidth=2)\n",
199-
"ax3.plot(cdS[:(r+1)],'o',color='r',LineWidth=2)\n",
197+
"ax3.plot(cdS,'-o',color='k',linewidth=2)\n",
198+
"ax3.plot(cdS[:(r90+1)],'o',color='b',linewidth=2)\n",
199+
"ax3.plot(cdS[:(r+1)],'o',color='r',linewidth=2)\n",
200200
"plt.xticks(np.array([0, 300, r90, 600]))\n",
201201
"plt.yticks(np.array([0, 0.5, 0.9, 1]))\n",
202202
"plt.xlim((-10,610))\n",
203-
"ax3.plot(np.array([r90, r90, -10]),np.array([0, 0.9, 0.9]),'--',color='b',LineWidth=2)\n",
203+
"ax3.plot(np.array([r90, r90, -10]),np.array([0, 0.9, 0.9]),'--',color='b',linewidth=2)\n",
204204
"\n",
205205
"ax3.grid()\n",
206206
"plt.show()\n",

CH01/CH01_SEC08_RSVD.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@
136136
" [1,0,0],\n",
137137
" [2/3,0,0]])\n",
138138
"\n",
139-
"plt.plot(S,'o-',color='k',LineWidth=2,label='SVD')\n",
139+
"plt.plot(S,'o-',color='k',linewidth=2,label='SVD')\n",
140140
"\n",
141141
"Y = X\n",
142142
"for q in range(1,6):\n",
143143
" Y = X.T @ Y\n",
144144
" Y = X @ Y\n",
145145
" Uq, Sq, VTq = np.linalg.svd(Y,full_matrices=0)\n",
146-
" plt.plot(Sq,'-o',color=tuple(color_list[2*q+1]),LineWidth=2,label='rSVD, q = '+str(q))\n",
146+
" plt.plot(Sq,'-o',color=tuple(color_list[2*q+1]),linewidth=2,label='rSVD, q = '+str(q))\n",
147147
"\n",
148148
"plt.legend()\n",
149149
"plt.show()"

CH01/CH01_SEC09_Tensor.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77464,9 +77464,9 @@
7746477464
"A1, A2, A3 = parafac(A,2)\n",
7746577465
"\n",
7746677466
"fig, axs = plt.subplots(3,1)\n",
77467-
"axs[0].plot(y,A1,LineWidth=2)\n",
77468-
"axs[1].plot(x,A2,LineWidth=2)\n",
77469-
"axs[2].plot(t,A3,LineWidth=2)\n",
77467+
"axs[0].plot(y,A1,linewidth=2)\n",
77468+
"axs[1].plot(x,A2,linewidth=2)\n",
77469+
"axs[2].plot(t,A3,linewidth=2)\n",
7747077470
"plt.show()"
7747177471
]
7747277472
},
@@ -77501,7 +77501,7 @@
7750177501
"name": "python",
7750277502
"nbconvert_exporter": "python",
7750377503
"pygments_lexer": "ipython3",
77504-
"version": "3.7.3"
77504+
"version": "3.8.5"
7750577505
}
7750677506
},
7750777507
"nbformat": 4,

CH02/CH02_SEC01_0_InnerProduct.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
"ff = f_interp(xf) \n",
4141
"gf = g_interp(xf)\n",
4242
"\n",
43-
"plt.plot(xf[10:-10],ff[10:-10],color='k',LineWidth=2)\n",
43+
"plt.plot(xf[10:-10],ff[10:-10],color='k',linewidth=2)\n",
4444
"plt.plot(x[1:-2],f[1:-2],'o',color='b')\n",
4545
"\n",
46-
"plt.plot(xf[10:-10],gf[10:-10],color='k',LineWidth=2)\n",
46+
"plt.plot(xf[10:-10],gf[10:-10],color='k',linewidth=2)\n",
4747
"plt.plot(x[1:-2],g[1:-2],'o',color='r')\n",
4848
"\n",
4949
"plt.show()\n"

CH02/CH02_SEC01_1_FourierSines.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"f[2*nquart:3*nquart] = np.ones(nquart) - (4/n)*np.arange(0,nquart)\n",
4040
"\n",
4141
"fig, ax = plt.subplots()\n",
42-
"ax.plot(x,f,'-',color='k',LineWidth=2)\n",
42+
"ax.plot(x,f,'-',color='k',linewidth=2)\n",
4343
"\n",
4444
"# Compute Fourier series\n",
4545
"name = \"Accent\"\n",
@@ -99,13 +99,13 @@
9999
"r = np.max(np.where(ERR > thresh))\n",
100100
"\n",
101101
"fig, axs = plt.subplots(2,1)\n",
102-
"axs[0].semilogy(np.arange(kmax),A,color='k',LineWidth=2)\n",
103-
"axs[0].semilogy(r,A[r],'o',color='b',MarkerSize=10)\n",
102+
"axs[0].semilogy(np.arange(kmax),A,color='k',linewidth=2)\n",
103+
"axs[0].semilogy(r,A[r],'o',color='b',markersize=10)\n",
104104
"plt.sca(axs[0])\n",
105105
"plt.title('Fourier Coefficients')\n",
106106
"\n",
107-
"axs[1].semilogy(np.arange(kmax),ERR,color='k',LineWidth=2)\n",
108-
"axs[1].semilogy(r,ERR[r],'o',color='b',MarkerSize=10)\n",
107+
"axs[1].semilogy(np.arange(kmax),ERR,color='k',linewidth=2)\n",
108+
"axs[1].semilogy(r,ERR[r],'o',color='b',markersize=10)\n",
109109
"plt.sca(axs[1])\n",
110110
"plt.title('Error')\n",
111111
"\n",

CH02/CH02_SEC01_2_Gibbs.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
" Bk = np.sum(f * np.sin(2*np.pi*k*x/L)) * dx * 2 / L\n",
4242
" fFS = fFS + Ak*np.cos(2*k*np.pi*x/L) + Bk*np.sin(2*k*np.pi*x/L)\n",
4343
" \n",
44-
"plt.plot(x,f,color='k',LineWidth=2)\n",
45-
"plt.plot(x,fFS,'-',color='r',LineWidth=1.5)\n",
44+
"plt.plot(x,f,color='k',linewidth=2)\n",
45+
"plt.plot(x,fFS,'-',color='r',linewidth=1.5)\n",
4646
"plt.show()"
4747
]
4848
},

CH02/CH02_SEC01_2_Gibbs_Movie.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41074,8 +41074,8 @@
4107441074
"fFS = A0/2 * np.ones_like(f)\n",
4107541075
"\n",
4107641076
"fig,ax = plt.subplots()\n",
41077-
"plt.plot(x,f,color='k',LineWidth=2)\n",
41078-
"fFS_plot, = plt.plot([],[],color='r',LineWidth=2)\n",
41077+
"plt.plot(x,f,color='k',linewidth=2)\n",
41078+
"fFS_plot, = plt.plot([],[],color='r',linewidth=2)\n",
4107941079
"\n",
4108041080
"all_fFS = np.zeros((len(fFS),101))\n",
4108141081
"all_fFS[:,0] = fFS\n",

CH02/CH02_SEC02_2_Denoise.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@
7070
"fig,axs = plt.subplots(3,1)\n",
7171
"\n",
7272
"plt.sca(axs[0])\n",
73-
"plt.plot(t,f,color='r',LineWidth=1.5,label='Noisy')\n",
74-
"plt.plot(t,f_clean,color='k',LineWidth=2,label='Clean')\n",
73+
"plt.plot(t,f,color='r',linewidth=1.5,label='Noisy')\n",
74+
"plt.plot(t,f_clean,color='k',linewidth=2,label='Clean')\n",
7575
"plt.xlim(t[0],t[-1])\n",
7676
"plt.legend()\n",
7777
"\n",
7878
"plt.sca(axs[1])\n",
79-
"plt.plot(t,f_clean,color='k',LineWidth=1.5,label='Clean')\n",
80-
"plt.plot(t,ffilt,color='b',LineWidth=2,label='Filtered')\n",
79+
"plt.plot(t,f_clean,color='k',linewidth=1.5,label='Clean')\n",
80+
"plt.plot(t,ffilt,color='b',linewidth=2,label='Filtered')\n",
8181
"plt.xlim(t[0],t[-1])\n",
8282
"plt.legend()\n",
8383
"\n",
8484
"plt.sca(axs[2])\n",
85-
"plt.plot(freq[L],PSD[L],color='r',LineWidth=2,label='Noisy')\n",
86-
"plt.plot(freq[L],PSDclean[L],color='b',LineWidth=1.5,label='Filtered')\n",
85+
"plt.plot(freq[L],PSD[L],color='r',linewidth=2,label='Noisy')\n",
86+
"plt.plot(freq[L],PSDclean[L],color='b',linewidth=1.5,label='Filtered')\n",
8787
"plt.xlim(freq[L[0]],freq[L[-1]])\n",
8888
"plt.legend()\n",
8989
"\n",

CH02/CH02_SEC02_3_SpectralDerivative.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
],
6969
"source": [
7070
"## Plots\n",
71-
"plt.plot(x,df.real,color='k',LineWidth=2,label='True Derivative')\n",
72-
"plt.plot(x,dfFD.real,'--',color='b',LineWidth=1.5,label='Finite Diff.')\n",
73-
"plt.plot(x,dfFFT.real,'--',color='r',LineWidth=1.5,label='FFT Derivative')\n",
71+
"plt.plot(x,df.real,color='k',linewidth=2,label='True Derivative')\n",
72+
"plt.plot(x,dfFD.real,'--',color='b',linewidth=1.5,label='Finite Diff.')\n",
73+
"plt.plot(x,dfFFT.real,'--',color='r',linewidth=1.5,label='FFT Derivative')\n",
7474
"plt.legend()\n",
7575
"plt.show()"
7676
]

CH02/CH02_SEC05_HAAR.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
"f22 = np.pad(f22, (2, 2), 'constant')\n",
5454
"\n",
5555
"fig,axs = plt.subplots(3,1)\n",
56-
"axs[0].plot(x,f10,color='k',LineWidth=2)\n",
56+
"axs[0].plot(x,f10,color='k',linewidth=2)\n",
5757
"axs[0].set_xlim(-0.2,1.2)\n",
5858
"axs[0].set_ylim(-1.75,1.75)\n",
59-
"axs[1].plot(x,f21,color='k',LineWidth=2)\n",
59+
"axs[1].plot(x,f21,color='k',linewidth=2)\n",
6060
"axs[1].set_xlim(-0.2,1.2)\n",
6161
"axs[1].set_ylim(-1.75,1.75)\n",
62-
"axs[2].plot(x,f22,color='k',LineWidth=2)\n",
62+
"axs[2].plot(x,f22,color='k',linewidth=2)\n",
6363
"axs[2].set_xlim(-0.2,1.2)\n",
6464
"axs[2].set_ylim(-1.75,1.75)\n",
6565
"plt.show()"
@@ -86,7 +86,7 @@
8686
"source": [
8787
"x = np.arange(-5,5,0.001)\n",
8888
"fMexHat = (1-np.power(x,2)) * np.exp(-np.power(x,2)/2)\n",
89-
"plt.plot(x,fMexHat,color='k',LineWidth=2)\n",
89+
"plt.plot(x,fMexHat,color='k',linewidth=2)\n",
9090
"plt.show()"
9191
]
9292
},

CH03/CH03_SEC03_1_Underdetermined.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
"source": [
6161
"fig,axs = plt.subplots(2,2)\n",
6262
"axs = axs.reshape(-1)\n",
63-
"axs[0].plot(s_L1,color='b',LineWidth=1.5)\n",
63+
"axs[0].plot(s_L1,color='b',linewidth=1.5)\n",
6464
"axs[0].set_ylim(-0.2,0.2)\n",
65-
"axs[1].plot(s_L2,color='r',LineWidth=1.5)\n",
65+
"axs[1].plot(s_L2,color='r',linewidth=1.5)\n",
6666
"axs[1].set_ylim(-0.2,0.2)\n",
6767
"axs[2].hist(s_L1,bins=np.arange(-0.105,0.105,0.01),rwidth=0.9)\n",
6868
"axs[3].hist(s_L2,bins=np.arange(-0.105,0.105,0.01),rwidth=0.9)\n",

CH03/CH03_SEC03_2_AudioCS.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,23 @@
112112
"fig,axs = plt.subplots(2,2)\n",
113113
"axs = axs.reshape(-1)\n",
114114
"\n",
115-
"axs[1].plot(freq[:L],PSD[:L],color='k',LineWidth=2)\n",
115+
"axs[1].plot(freq[:L],PSD[:L],color='k',linewidth=2)\n",
116116
"axs[1].set_xlim(0, 1024)\n",
117117
"axs[1].set_ylim(0, 1200)\n",
118118
"\n",
119-
"axs[0].plot(t,x,color='k',LineWidth=2)\n",
120-
"axs[0].plot(perm/n,y,color='r',marker='x',LineWidth=0,ms=12,mew=4)\n",
119+
"axs[0].plot(t,x,color='k',linewidth=2)\n",
120+
"axs[0].plot(perm/n,y,color='r',marker='x',linewidth=0,ms=12,mew=4)\n",
121121
"axs[0].set_xlim(time_window[0],time_window[1])\n",
122122
"axs[0].set_ylim(-2, 2)\n",
123123
"\n",
124-
"axs[2].plot(t,xrecon,color='r',LineWidth=2)\n",
124+
"axs[2].plot(t,xrecon,color='r',linewidth=2)\n",
125125
"axs[2].set_xlim(time_window[0],time_window[1])\n",
126126
"axs[2].set_ylim(-2, 2)\n",
127127
"\n",
128128
"xtrecon = np.fft.fft(xrecon,n) # computes the (fast) discrete fourier transform\n",
129129
"PSDrecon = xtrecon * np.conj(xtrecon)/n # Power spectrum (how much power in each freq)\n",
130130
"\n",
131-
"axs[3].plot(freq[:L],PSDrecon[:L],color='r',LineWidth=2)\n",
131+
"axs[3].plot(freq[:L],PSDrecon[:L],color='r',linewidth=2)\n",
132132
"axs[3].set_xlim(0, 1024)\n",
133133
"axs[3].set_ylim(0, 1200)\n",
134134
"\n",

CH04/CH04_SEC01_LinearRegression.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@
8080
"\n",
8181
"plt.figure()\n",
8282
"plt.plot(xf,y1,color='k',label='E_\\infty')\n",
83-
"plt.plot(xf,y2,'--',color='k',LineWidth=2,label='E_1')\n",
84-
"plt.plot(xf,y3,color='k',LineWidth=2,label='E_2')\n",
85-
"plt.plot(x,y,'o',color='r',LineWidth=2)\n",
83+
"plt.plot(xf,y2,'--',color='k',linewidth=2,label='E_1')\n",
84+
"plt.plot(xf,y3,color='k',linewidth=2,label='E_2')\n",
85+
"plt.plot(x,y,'o',color='r',linewidth=2)\n",
8686
"\n",
8787
"plt.ylim(0,4)\n",
8888
"plt.legend()\n",
@@ -142,9 +142,9 @@
142142
"\n",
143143
"plt.figure()\n",
144144
"plt.plot(xf,y1,color='k',label='E_\\infty')\n",
145-
"plt.plot(xf,y2,'--',color='k',LineWidth=2,label='E_1')\n",
146-
"plt.plot(xf,y3,color='k',LineWidth=2,label='E_2')\n",
147-
"plt.plot(x,y,'o',color='r',LineWidth=2)\n",
145+
"plt.plot(xf,y2,'--',color='k',linewidth=2,label='E_1')\n",
146+
"plt.plot(xf,y3,color='k',linewidth=2,label='E_2')\n",
147+
"plt.plot(x,y,'o',color='r',linewidth=2)\n",
148148
"\n",
149149
"plt.ylim(0,4)\n",
150150
"plt.legend()\n",

CH04/CH04_SEC02_1_GradientDescent.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"fig,ax = plt.subplots(1,1,subplot_kw={'projection': '3d'})\n",
151151
"ax.plot_surface(X, Y, Fquad,linewidth=0,color='k',alpha=0.3)\n",
152152
"ax.scatter(x,y,f,'o',color='r',s=200)\n",
153-
"ax.plot(x,y,f,':',color='k',LineWidth=3)\n",
153+
"ax.plot(x,y,f,':',color='k',linewidth=3)\n",
154154
"ax.contour(X, Y, Fquad, zdir='z', offset=ax.get_zlim()[0], cmap='gray')\n",
155155
"ax.view_init(elev=40, azim=-140)\n",
156156
"plt.show()"
@@ -279,11 +279,11 @@
279279
"source": [
280280
"fig,ax = plt.subplots(1,1,subplot_kw={'projection': '3d'})\n",
281281
"ax.plot_surface(X, Y, F-0.2,cmap='binary',alpha=0.5)\n",
282-
"ax.plot(x1,y1,f1,'o',color='r',MarkerSize=10)\n",
282+
"ax.plot(x1,y1,f1,'o',color='r',markersize=10)\n",
283283
"ax.plot(x1,y1,f1,':',color='k')\n",
284-
"ax.plot(x2,y2,f2,'o',color='m',MarkerSize=10)\n",
284+
"ax.plot(x2,y2,f2,'o',color='m',markersize=10)\n",
285285
"ax.plot(x2,y2,f2,':',color='k')\n",
286-
"ax.plot(x3,y3,f3,'o',color='b',MarkerSize=10)\n",
286+
"ax.plot(x3,y3,f3,'o',color='b',markersize=10)\n",
287287
"ax.plot(x3,y3,f3,':',color='k')\n",
288288
"ax.view_init(elev=40, azim=-100)\n",
289289
"plt.show()"
@@ -402,11 +402,11 @@
402402
"source": [
403403
"fig,ax = plt.subplots(1,1,subplot_kw={'projection': '3d'})\n",
404404
"ax.plot_surface(X, Y, F-0.2,cmap='binary',alpha=0.5)\n",
405-
"ax.plot(x1,y1,f1,'o',color='r',MarkerSize=10)\n",
405+
"ax.plot(x1,y1,f1,'o',color='r',markersize=10)\n",
406406
"ax.plot(x1,y1,f1,':',color='k')\n",
407-
"ax.plot(x2,y2,f2,'o',color='m',MarkerSize=10)\n",
407+
"ax.plot(x2,y2,f2,'o',color='m',markersize=10)\n",
408408
"ax.plot(x2,y2,f2,':',color='k')\n",
409-
"ax.plot(x3,y3,f3,'o',color='b',MarkerSize=10)\n",
409+
"ax.plot(x3,y3,f3,'o',color='b',markersize=10)\n",
410410
"ax.plot(x3,y3,f3,':',color='k')\n",
411411
"ax.view_init(elev=40, azim=-100)\n",
412412
"plt.show()"

0 commit comments

Comments
 (0)