Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Book3_Ch17_Python_Codes/Bk3_Ch17_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@

ax.set_xlim(-3,3)
ax.set_ylim(-1.25,1.25)

plt.show()
2 changes: 2 additions & 0 deletions Book3_Ch17_Python_Codes/Bk3_Ch17_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,5 @@
ax.set_ylim(np.floor(error.min()),np.ceil(error.max()))
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)

plt.show()
2 changes: 2 additions & 0 deletions Book3_Ch18_Python_Codes/Bk3_Ch18_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@
integral_a_b_v2 = float(integral_a_b_v2)

ax.set_title(r'$\int_a^b f(x) = %0.4f$'%integral_a_b)

plt.show()
2 changes: 2 additions & 0 deletions Book3_Ch18_Python_Codes/Bk3_Ch18_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@
ax.set_xlabel('x')
ax.set_ylabel('Integral, F(x)')
ax.grid(linestyle='--', linewidth=0.25, color=[0.75,0.75,0.75])

plt.show()
6 changes: 6 additions & 0 deletions Book3_Ch18_Python_Codes/Bk3_Ch18_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from sympy import oo, erf, lambdify
import numpy as np
from matplotlib import pyplot as plt
from sympy import *

x = Symbol('x')

x_array = np.linspace(-3,3,100)

Expand All @@ -30,3 +34,5 @@
ax.set_xlabel('x')
ax.set_ylabel('erf(x)')
ax.grid(linestyle='--', linewidth=0.25, color=[0.75,0.75,0.75])

plt.show()
3 changes: 3 additions & 0 deletions Book3_Ch18_Python_Codes/Bk3_Ch18_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import numpy as np
from scipy.special import factorial
from matplotlib import pyplot as plt

n_array = np.linspace(0,10,11)

Expand All @@ -25,3 +26,5 @@
plt.tight_layout()
plt.xlabel('n')
plt.ylabel('Estimate of $\pi$')

plt.show()
4 changes: 3 additions & 1 deletion Book3_Ch18_Python_Codes/Bk3_Ch18_07.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Beijing, China, 2022
###############

Bk3_Ch18_07.py
# Bk3_Ch18_07.py

import numpy as np
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -143,3 +143,5 @@
plt.gca().spines['top'].set_visible(False)
plt.xlabel('x')
plt.ylabel('f(x)')

plt.show()
2 changes: 1 addition & 1 deletion Book3_Ch18_Python_Codes/Bk3_Ch18_08.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Beijing, China, 2022
###############

Bk3_Ch18_08.py
# Bk3_Ch18_08.py

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
Expand Down