diff --git a/Book3_Ch17_Python_Codes/Bk3_Ch17_01.py b/Book3_Ch17_Python_Codes/Bk3_Ch17_01.py index 79f863e..44801f8 100644 --- a/Book3_Ch17_Python_Codes/Bk3_Ch17_01.py +++ b/Book3_Ch17_Python_Codes/Bk3_Ch17_01.py @@ -118,3 +118,5 @@ ax.set_xlim(-3,3) ax.set_ylim(-1.25,1.25) + +plt.show() \ No newline at end of file diff --git a/Book3_Ch17_Python_Codes/Bk3_Ch17_02.py b/Book3_Ch17_Python_Codes/Bk3_Ch17_02.py index df51c83..8bc08fa 100644 --- a/Book3_Ch17_Python_Codes/Bk3_Ch17_02.py +++ b/Book3_Ch17_Python_Codes/Bk3_Ch17_02.py @@ -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() \ No newline at end of file diff --git a/Book3_Ch18_Python_Codes/Bk3_Ch18_01.py b/Book3_Ch18_Python_Codes/Bk3_Ch18_01.py index 14c0eb6..20bada9 100644 --- a/Book3_Ch18_Python_Codes/Bk3_Ch18_01.py +++ b/Book3_Ch18_Python_Codes/Bk3_Ch18_01.py @@ -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() diff --git a/Book3_Ch18_Python_Codes/Bk3_Ch18_02.py b/Book3_Ch18_Python_Codes/Bk3_Ch18_02.py index c83f207..6171ae3 100644 --- a/Book3_Ch18_Python_Codes/Bk3_Ch18_02.py +++ b/Book3_Ch18_Python_Codes/Bk3_Ch18_02.py @@ -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() \ No newline at end of file diff --git a/Book3_Ch18_Python_Codes/Bk3_Ch18_03.py b/Book3_Ch18_Python_Codes/Bk3_Ch18_03.py index c9bdcf3..9bffb37 100644 --- a/Book3_Ch18_Python_Codes/Bk3_Ch18_03.py +++ b/Book3_Ch18_Python_Codes/Bk3_Ch18_03.py @@ -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) @@ -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() diff --git a/Book3_Ch18_Python_Codes/Bk3_Ch18_06.py b/Book3_Ch18_Python_Codes/Bk3_Ch18_06.py index 3efb925..ca48a15 100644 --- a/Book3_Ch18_Python_Codes/Bk3_Ch18_06.py +++ b/Book3_Ch18_Python_Codes/Bk3_Ch18_06.py @@ -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) @@ -25,3 +26,5 @@ plt.tight_layout() plt.xlabel('n') plt.ylabel('Estimate of $\pi$') + +plt.show() diff --git a/Book3_Ch18_Python_Codes/Bk3_Ch18_07.py b/Book3_Ch18_Python_Codes/Bk3_Ch18_07.py index 5f35c16..dc10081 100644 --- a/Book3_Ch18_Python_Codes/Bk3_Ch18_07.py +++ b/Book3_Ch18_Python_Codes/Bk3_Ch18_07.py @@ -6,7 +6,7 @@ # Beijing, China, 2022 ############### -Bk3_Ch18_07.py +# Bk3_Ch18_07.py import numpy as np import matplotlib.pyplot as plt @@ -143,3 +143,5 @@ plt.gca().spines['top'].set_visible(False) plt.xlabel('x') plt.ylabel('f(x)') + +plt.show() diff --git a/Book3_Ch18_Python_Codes/Bk3_Ch18_08.py b/Book3_Ch18_Python_Codes/Bk3_Ch18_08.py index e235fd9..644c3fc 100644 --- a/Book3_Ch18_Python_Codes/Bk3_Ch18_08.py +++ b/Book3_Ch18_Python_Codes/Bk3_Ch18_08.py @@ -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