From 2242b61d77747feed8bccfe87f662d5608d01110 Mon Sep 17 00:00:00 2001 From: Visualize-ML <105787223+Visualize-ML@users.noreply.github.com> Date: Fri, 2 Sep 2022 06:06:03 -0400 Subject: [PATCH] Delete Bk4_Ch1_03.py --- Book4_Ch01_Python_Codes/Bk4_Ch1_03.py | 36 --------------------------- 1 file changed, 36 deletions(-) delete mode 100644 Book4_Ch01_Python_Codes/Bk4_Ch1_03.py diff --git a/Book4_Ch01_Python_Codes/Bk4_Ch1_03.py b/Book4_Ch01_Python_Codes/Bk4_Ch1_03.py deleted file mode 100644 index d16adf1..0000000 --- a/Book4_Ch01_Python_Codes/Bk4_Ch1_03.py +++ /dev/null @@ -1,36 +0,0 @@ - -############### -# Authored by Weisheng Jiang -# Book 4 | From Basic Arithmetic to Machine Learning -# Published and copyrighted by Tsinghua University Press -# Beijing, China, 2022 -############### - -# Bk4_Ch1_03.py - -import matplotlib.pyplot as plt -import numpy as np - -x1 = np.linspace(-10, 10, num=201); -x2 = x1; - -xx1, xx2 = np.meshgrid(x1,x2) -p = 2 -zz = ((np.abs((xx1))**p) + (np.abs((xx2))**p))**(1./p) - -fig, ax = plt.subplots(figsize=(12, 12)) - -ax.contour(xx1, xx2, zz, levels = np.arange(11), cmap='RdYlBu_r') - -ax.axhline(y=0, color='k', linewidth = 0.25) -ax.axvline(x=0, color='k', linewidth = 0.25) -ax.set_xlim(-12, 12) -ax.set_ylim(-12, 12) -ax.spines['top'].set_visible(False) -ax.spines['right'].set_visible(False) -ax.spines['bottom'].set_visible(False) -ax.spines['left'].set_visible(False) -ax.set_xlabel('$x_1$') -ax.set_ylabel('$x_2$') -ax.set_aspect('equal', adjustable='box') -plt.show()