You need to sign in or sign up before continuing.
Newer
Older
# Exercise 2.3.6
# requires data from exercise 2.3.1
from ex2_3_1 import *
from matplotlib.pyplot import figure, show
from mpl_toolkits.mplot3d import Axes3D
ax = f.add_subplot(111, projection="3d") # Here the mpl_toolkits is used
class_mask = y == c
s = ax.scatter(
X[class_mask, ind[0]], X[class_mask, ind[1]], X[class_mask, ind[2]], c=colors[c]
)
ax.view_init(30, 220)
ax.set_xlabel(attributeNames[ind[0]])
ax.set_ylabel(attributeNames[ind[1]])
ax.set_zlabel(attributeNames[ind[2]])
show()
print("Ran Exercise 2.3.6")