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 Book4_Ch08_Python_Codes/Bk4_Ch8_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ def plot_shape(X,copy = False):
ax.spines['left'].set_visible(False)
plt.xlabel('$x_1$')
plt.ylabel('$x_2$')

plt.show()
11 changes: 7 additions & 4 deletions Book4_Ch08_Python_Codes/Bk4_Ch8_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def plot_shape(X,copy = False):
markeredgecolor = edge_color*0.5,
linestyle = 'None')



X = np.array([[1,1],
[0,-1],
[-1,-1],
Expand All @@ -35,12 +37,11 @@ def plot_shape(X,copy = False):
# visualizations

thetas = np.linspace(30, 330, num=11)
fig, ax = plt.subplots()

for theta in thetas:
for theta in thetas:

fig, ax = plt.subplots()

theta = theta/180*np.pi;
theta = theta/180*np.pi
# rotation
R = np.array([[np.cos(theta), np.sin(theta)],
[-np.sin(theta), np.cos(theta)]])
Expand All @@ -66,3 +67,5 @@ def plot_shape(X,copy = False):
ax.spines['left'].set_visible(False)
plt.xlabel('$x_1$')
plt.ylabel('$x_2$')

plt.show()